diff --git a/src/main/groovy/projects/patientfinder/README.md b/src/main/groovy/projects/patientfinder/README.md index ab9a05fb..71dc21e6 100644 --- a/src/main/groovy/projects/patientfinder/README.md +++ b/src/main/groovy/projects/patientfinder/README.md @@ -13,6 +13,9 @@ The following imported data sets are supported/tested: # Change log +## 2024-11-06 +* moved telecom information from Patient.contact.telecom to Patient.telecom + ## 2024-10-17 * Added the export of MedicationRequest requester from LaborMapping diff --git a/src/main/groovy/projects/patientfinder/patient.groovy b/src/main/groovy/projects/patientfinder/patient.groovy index f9b606d7..1ab4a50d 100644 --- a/src/main/groovy/projects/patientfinder/patient.groovy +++ b/src/main/groovy/projects/patientfinder/patient.groovy @@ -2,8 +2,6 @@ package projects.patientfinder import de.kairos.centraxx.fhir.r4.utils.FhirUrls import de.kairos.fhir.centraxx.metamodel.Country -import de.kairos.fhir.centraxx.metamodel.Ethnicity -import de.kairos.fhir.centraxx.metamodel.Multilingual import de.kairos.fhir.centraxx.metamodel.PatientAddress import de.kairos.fhir.centraxx.metamodel.enums.GenderType import org.hl7.fhir.r4.model.codesystems.ContactPointSystem @@ -12,12 +10,9 @@ import static de.kairos.fhir.centraxx.metamodel.AbstractCode.CODE import static de.kairos.fhir.centraxx.metamodel.AbstractIdContainer.ID_CONTAINER_TYPE import static de.kairos.fhir.centraxx.metamodel.AbstractIdContainer.PSN import static de.kairos.fhir.centraxx.metamodel.IdContainerType.DECISIVE -import static de.kairos.fhir.centraxx.metamodel.Multilingual.LANGUAGE -import static de.kairos.fhir.centraxx.metamodel.Multilingual.NAME import static de.kairos.fhir.centraxx.metamodel.PatientMaster.GENDER_TYPE import static de.kairos.fhir.centraxx.metamodel.RootEntities.patient import static de.kairos.fhir.centraxx.metamodel.RootEntities.patientMasterDataAnonymous - /** * Represented by a CXX PatientMasterDataAnonymous * Specified: http://www.hl7.org/fhir/us/core/StructureDefinition-us-core-patient.html @@ -48,10 +43,9 @@ patient { } humanName { - use = "official" + text = context.source[patient().firstName()] + " " + context.source[patient().lastName()] family = context.source[patient().lastName()] - given context.source[patient().firstName()] as String - prefix context.source[patient().title().multilinguals()]?.find { it[LANGUAGE] == "en" }?.getAt(Multilingual.DESCRIPTION) as String + given(context.source[patient().firstName()] as String) } if (context.source[patient().birthName()]) { @@ -84,26 +78,14 @@ patient { line lineString } } - contact { - telecom { - system = ContactPointSystem.PHONE.toCode() - value = ad[PatientAddress.PHONE1] - } - telecom { - system = ContactPointSystem.EMAIL.toCode() - value = ad[PatientAddress.EMAIL] - } - } - } - final def firstEthnicity = context.source[patient().patientContainer().ethnicities()].find { final def ethnicity -> ethnicity != null } - if (firstEthnicity != null) { - extension { - url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity" - extension { - url = "text" - valueString = firstEthnicity[Ethnicity.MULTILINGUALS].find { it[LANGUAGE] == "en"}?.getAt(NAME) as String - } + telecom { + system = ContactPointSystem.PHONE.toCode() + value = ad[PatientAddress.PHONE1] + } + telecom { + system = ContactPointSystem.EMAIL.toCode() + value = ad[PatientAddress.EMAIL] } } }