Search in sources :

Example 16 with PartySelf

use of com.nedap.archie.rm.generic.PartySelf in project fhir-bridge by ehrbase.

the class ZusammenfassungRauchverhaltenEvaluationConverter method convertInternal.

@Override
protected ZusammenfassungRauchverhaltenEvaluation convertInternal(QuestionnaireResponse.QuestionnaireResponseItemComponent questionnaireResponseItemComponent) {
    ZusammenfassungRauchverhaltenEvaluation zusammenfassungRauchverhaltenEvaluation = new ZusammenfassungRauchverhaltenEvaluation();
    zusammenfassungRauchverhaltenEvaluation.setLanguage(Language.DE);
    zusammenfassungRauchverhaltenEvaluation.setSubject(new PartySelf());
    if (getQuestionLoincYesNoToBoolean(questionnaireResponseItemComponent)) {
        zusammenfassungRauchverhaltenEvaluation.setRaucherDefiningCode(RaucherDefiningCode.JA);
    } else {
        zusammenfassungRauchverhaltenEvaluation.setRaucherDefiningCode(RaucherDefiningCode.NEIN);
    }
    return zusammenfassungRauchverhaltenEvaluation;
}
Also used : ZusammenfassungRauchverhaltenEvaluation(org.ehrbase.fhirbridge.ehr.opt.d4lquestionnairecomposition.definition.ZusammenfassungRauchverhaltenEvaluation) PartySelf(com.nedap.archie.rm.generic.PartySelf)

Example 17 with PartySelf

use of com.nedap.archie.rm.generic.PartySelf in project fhir-bridge by ehrbase.

the class QuestionnaireResponseItemToEntryEntityConverter method convert.

@Override
public E convert(@NonNull QuestionnaireResponse.QuestionnaireResponseItemComponent questionnaireResponseItemComponent, Language language, TemporalAccessor temporalAccessor) {
    E entity = convertInternal(questionnaireResponseItemComponent);
    entity.setLanguage(language);
    entity.setSubject(new PartySelf());
    return entity;
}
Also used : PartySelf(com.nedap.archie.rm.generic.PartySelf)

Example 18 with PartySelf

use of com.nedap.archie.rm.generic.PartySelf in project fhir-bridge by ehrbase.

the class EhrLookupProcessor method createEhr.

/**
 * Creates an EHR for the given patient ID.
 *
 * @param patientId the given patient ID
 * @return the EHR ID
 */
private UUID createEhr(IIdType patientId) {
    Patient patient = patientDao.read(patientId);
    Identifier pseudonym = PatientUtils.getPseudonym(patient);
    PartySelf subject = new PartySelf(new PartyRef(new HierObjectId(pseudonym.getValue()), "DEMOGRAPHIC", "PERSON"));
    EhrStatus ehrStatus = new EhrStatus(ARCHETYPE_NODE_ID, new DvText("EHR Status"), subject, true, true, null);
    UUID ehrId = openEhrClient.ehrEndpoint().createEhr(ehrStatus);
    PatientEhr patientEhr = new PatientEhr(patientId.getIdPart(), ehrId);
    patientEhrRepository.save(patientEhr);
    LOG.debug("Created PatientEhr: patientId={}, ehrId={}", patientEhr.getPatientId(), patientEhr.getEhrId());
    return ehrId;
}
Also used : PartyRef(com.nedap.archie.rm.support.identification.PartyRef) Identifier(org.hl7.fhir.r4.model.Identifier) EhrStatus(com.nedap.archie.rm.ehr.EhrStatus) Patient(org.hl7.fhir.r4.model.Patient) UUID(java.util.UUID) HierObjectId(com.nedap.archie.rm.support.identification.HierObjectId) PartySelf(com.nedap.archie.rm.generic.PartySelf) DvText(com.nedap.archie.rm.datavalues.DvText) PatientEhr(org.ehrbase.fhirbridge.core.domain.PatientEhr)

Example 19 with PartySelf

use of com.nedap.archie.rm.generic.PartySelf in project fhir-bridge by ehrbase.

the class DnrAnordnungCompositionConverter method createDnrAnordnung.

// Not an Resource so just leave it as it is
private DnrAnordnungEvaluation createDnrAnordnung(@NonNull Consent resource) {
    DnrAnordnungEvaluation dnrAnordnung = new DnrAnordnungEvaluation();
    dnrAnordnung.setLanguage(Language.DE);
    dnrAnordnung.setSubject(new PartySelf());
    dnrAnordnung.setArtDerRichtlinie(org.ehrbase.fhirbridge.ehr.converter.parser.DvCodedTextParser.parseDefiningCode(KategorieDefiningCode.DO_NOT_RESUSCITATE));
    getCoding(resource.getProvision()).ifPresent(dnrAnordnung::setBeschreibung);
    return dnrAnordnung;
}
Also used : DnrAnordnungEvaluation(org.ehrbase.fhirbridge.ehr.opt.dnranordnungcomposition.definition.DnrAnordnungEvaluation) PartySelf(com.nedap.archie.rm.generic.PartySelf)

Example 20 with PartySelf

use of com.nedap.archie.rm.generic.PartySelf in project openEHR_SDK by ehrbase.

the class DefaultRestEhrFieldsEndpointIT method testUpdateEhrStatus.

@Test
public void testUpdateEhrStatus() throws IOException {
    ehr = openEhrClient.ehrEndpoint().createEhr();
    EhrStatus ehrStatus = openEhrClient.ehrEndpoint().getEhrStatus(ehr).get();
    ehrStatus.setQueryable(false);
    ehrStatus.setModifiable(false);
    HierObjectId subjectId = new HierObjectId("6ee110de-08f8-4fac-8372-820650f150a9");
    ehrStatus.setSubject(new PartySelf(new PartyRef(subjectId, "default", "PERSON")));
    String value = IOUtils.toString(ItemStruktureTestDataCanonicalJson.SIMPLE_EHR_OTHER_Details.getStream(), UTF_8);
    ehrStatus.setOtherDetails(new CanonicalJson().unmarshal(value, ItemTree.class));
    ehrStatus.getOtherDetails().setArchetypeNodeId("other-details-test");
    ehrStatus.getOtherDetails().setName(new DvText("test"));
    openEhrClient.ehrEndpoint().updateEhrStatus(ehr, ehrStatus);
    EhrStatus actual = openEhrClient.ehrEndpoint().getEhrStatus(ehr).get();
    assertThat(actual.getSubject().getExternalRef().getId()).isEqualTo(subjectId);
    assertThat(actual.isModifiable()).isEqualTo(ehrStatus.isModifiable());
    assertThat(actual.isQueryable()).isEqualTo(ehrStatus.isQueryable());
    assertThat(actual.getOtherDetails()).isNotNull();
    assertThat(actual.getOtherDetails().getItems()).size().isEqualTo(ehrStatus.getOtherDetails().getItems().size());
}
Also used : PartyRef(com.nedap.archie.rm.support.identification.PartyRef) CanonicalJson(org.ehrbase.serialisation.jsonencoding.CanonicalJson) ItemStruktureTestDataCanonicalJson(org.ehrbase.test_data.item_structure.ItemStruktureTestDataCanonicalJson) EhrStatus(com.nedap.archie.rm.ehr.EhrStatus) ItemTree(com.nedap.archie.rm.datastructures.ItemTree) HierObjectId(com.nedap.archie.rm.support.identification.HierObjectId) PartySelf(com.nedap.archie.rm.generic.PartySelf) DvText(com.nedap.archie.rm.datavalues.DvText) Test(org.junit.Test)

Aggregations

PartySelf (com.nedap.archie.rm.generic.PartySelf)29 DvText (com.nedap.archie.rm.datavalues.DvText)9 EhrStatus (com.nedap.archie.rm.ehr.EhrStatus)9 PartyIdentified (com.nedap.archie.rm.generic.PartyIdentified)8 PartyRef (com.nedap.archie.rm.support.identification.PartyRef)8 HierObjectId (com.nedap.archie.rm.support.identification.HierObjectId)7 UUID (java.util.UUID)5 Test (org.junit.Test)4 DvDateTime (com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime)3 URI (java.net.URI)3 ItemTree (com.nedap.archie.rm.datastructures.ItemTree)2 DvCodedText (com.nedap.archie.rm.datavalues.DvCodedText)2 DvIdentifier (com.nedap.archie.rm.datavalues.DvIdentifier)2 GenericId (com.nedap.archie.rm.support.identification.GenericId)2 BodyTemperatureAnyEventPointEvent (org.ehrbase.client.classgenerator.examples.ehrbasemultioccurrencedev1composition.definition.BodyTemperatureAnyEventPointEvent)2 BodyTemperatureObservation (org.ehrbase.client.classgenerator.examples.ehrbasemultioccurrencedev1composition.definition.BodyTemperatureObservation)2 VirologischerBefundComposition (org.ehrbase.client.classgenerator.examples.virologischerbefundcomposition.VirologischerBefundComposition)2 ProVirusCluster (org.ehrbase.client.classgenerator.examples.virologischerbefundcomposition.definition.ProVirusCluster)2 DefaultValuePath (org.ehrbase.serialisation.walker.defaultvalues.DefaultValuePath)2 DefaultValues (org.ehrbase.serialisation.walker.defaultvalues.DefaultValues)2