use of com.nedap.archie.rm.datavalues.DvCodedText in project ehrbase by ehrbase.
the class EventContextFactory method makeNull.
public EventContext makeNull() {
PartyRef partyRef = new PartyRef(new HierObjectId("ref"), "null", "null");
PartyIdentified healthcareFacility = new PartyIdentified(partyRef, "null", null);
DvCodedText concept = new DvCodedText("Other Care", new CodePhrase(new TerminologyId("openehr"), "238"));
return new EventContext(healthcareFacility, new DvDateTime(new DateTime(0L).toString()), null, null, null, concept, null);
}
use of com.nedap.archie.rm.datavalues.DvCodedText in project ehrbase by ehrbase.
the class EventContextFactory method makeDummy.
public EventContext makeDummy() {
PartyRef partyRef = new PartyRef(new GenericId("123456-123", "EHRBASE-SCHEME"), "DEMOGRAPHIC", "PARTY");
PartyIdentified healthcareFacility = new PartyIdentified(partyRef, "FACILITY", null);
DateTime timenow = DateTime.now();
DvCodedText concept = new DvCodedText("Other Care", new CodePhrase(new TerminologyId("openehr"), "238"));
return new EventContext(healthcareFacility, new DvDateTime(timenow.toString()), null, null, "TEST LAB", concept, null);
}
use of com.nedap.archie.rm.datavalues.DvCodedText in project ehrbase by ehrbase.
the class StatusAccess method getStatus.
@Override
public EhrStatus getStatus() {
EhrStatus status = new EhrStatus();
status.setModifiable(getStatusRecord().getIsModifiable());
status.setQueryable(getStatusRecord().getIsQueryable());
// set otherDetails if available
if (getStatusRecord().getOtherDetails() != null) {
status.setOtherDetails(getStatusRecord().getOtherDetails());
}
// Locatable attribute
status.setArchetypeNodeId(getStatusRecord().getArchetypeNodeId());
Object name = new RecordedDvCodedText().fromDB(getStatusRecord(), STATUS.NAME);
status.setName(name instanceof DvText ? (DvText) name : (DvCodedText) name);
UUID statusId = getStatusRecord().getId();
status.setUid(new HierObjectId(statusId.toString() + "::" + getServerConfig().getNodename() + "::" + I_StatusAccess.getLatestVersionNumber(this, statusId)));
PartySelf partySelf = (PartySelf) new PersistedPartyProxy(this).retrieve(getStatusRecord().getParty());
status.setSubject(partySelf);
return status;
}
use of com.nedap.archie.rm.datavalues.DvCodedText in project ehrbase by ehrbase.
the class RecordedDvCodedTextTest method testFromDB.
@Test
public void testFromDB() {
Record record = new EventContextRecord();
DvCodedTextRecord dvCodedTextRecord = new DvCodedTextRecord();
dvCodedTextRecord.setValue("1234");
dvCodedTextRecord.setDefiningCode(new CodePhraseRecord("term1", "aaa"));
dvCodedTextRecord.setTermMapping(new String[] { ">|purpose|B|BBB|A|target" });
record.set(EventContext.EVENT_CONTEXT.SETTING, dvCodedTextRecord);
DvCodedText dvCodedText = (DvCodedText) new RecordedDvCodedText().fromDB(record, EventContext.EVENT_CONTEXT.SETTING);
assertEquals('>', dvCodedText.getMappings().get(0).getMatch());
}
use of com.nedap.archie.rm.datavalues.DvCodedText in project ehrbase by ehrbase.
the class ContributionServiceImp method retrieveAuditDetails.
/**
* retrieval and building of AuditDetails object attached to the given contribution context
* @param contributionId ID of contribution
* @return {@link AuditDetails} object from contribution
*/
private AuditDetails retrieveAuditDetails(UUID contributionId) {
UUID auditId = I_ContributionAccess.retrieveInstance(this.getDataAccess(), contributionId).getHasAuditDetails();
I_AuditDetailsAccess auditDetailsAccess = new AuditDetailsAccess(this.getDataAccess()).retrieveInstance(this.getDataAccess(), auditId);
String systemId = auditDetailsAccess.getSystemId().toString();
PartyProxy committer = new PersistedPartyProxy(this.getDataAccess()).retrieve(auditDetailsAccess.getCommitter());
DvDateTime timeCommitted = new DvDateTime(LocalDateTime.ofInstant(auditDetailsAccess.getTimeCommitted().toInstant(), ZoneId.of(auditDetailsAccess.getTimeCommittedTzId())));
int changeTypeCode = I_ConceptAccess.ContributionChangeType.valueOf(auditDetailsAccess.getChangeType().getLiteral().toUpperCase()).getCode();
// FIXME: what's the terminology ID of the official change type terminology?
DvCodedText changeType = new DvCodedText(auditDetailsAccess.getChangeType().getLiteral(), new CodePhrase(new TerminologyId("audit change type"), String.valueOf(changeTypeCode)));
DvText description = new DvText(auditDetailsAccess.getDescription());
return new AuditDetails(systemId, committer, timeCommitted, changeType, description);
}
Aggregations