Skip to content

Commit 6e02ebd

Browse files
committed
adding transform FHIR Bundle to OMOP Bundle (CoreFHIR2OMOP)
1 parent c5f8d8c commit 6e02ebd

File tree

2 files changed

+35
-20
lines changed

2 files changed

+35
-20
lines changed

input/fml/usages/core/StructureMap-CoreFHIRPatient2OMOP.fml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ map "https://aphp.fr/ig/fhir/dm/StructureMap/CoreFHIRPatient2OMOP" = "CoreFHIRPa
66
/// status = 'draft'
77

88
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as source
9-
uses "https://aphp.fr/ig/fhir/dm/StructureDefinition/LogicalBundle" alias LogicalBundle as target
9+
//uses "https://aphp.fr/ig/fhir/dm/StructureDefinition/LogicalBundle" alias LogicalBundle as target
1010
uses "https://aphp.fr/ig/fhir/dm/StructureDefinition/OMOPPerson" alias PersonTable as target
1111
uses "https://aphp.fr/ig/fhir/dm/StructureDefinition/OMOPLocation" alias LocationTable as target
1212
uses "https://aphp.fr/ig/fhir/dm/StructureDefinition/OMOPDeath" alias DeathTable as target
@@ -15,22 +15,14 @@ imports "https://aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPPerson"
1515
imports "https://aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPLocation"
1616
imports "https://aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPDeath"
1717

18-
group Patient(source src: Patient, target tgtBundle : LogicalBundle) {
19-
src -> tgtBundle.id = uuid() "setId";
20-
src -> tgtBundle.type = 'transaction' "setType";
21-
src -> tgtBundle.entry as newEntry then {
22-
src -> newEntry.person = create("PersonTable") as newPerson then {
23-
src then Person(src, newPerson) "transformPerson";
24-
} "createPerson";
25-
} "newEntryPerson";
26-
src.address as srcAddress where use = 'home' and period.end.empty() -> tgtBundle.entry as newEntry then {
27-
srcAddress -> newEntry.location = create("LocationTable") as newLocation then {
28-
srcAddress then Location(srcAddress, newLocation) "transformLocation";
29-
} "createLocation";
30-
} "newEntryLocation";
31-
src where deceased.is(System.DateTime) or deceased.is(System.Boolean) -> tgtBundle.entry as newEntry then {
32-
src -> newEntry.death = create("DeathTable") as newDeath then {
33-
src then Death(src, newDeath) "transformDeath";
34-
} "createDeath";
35-
} "newEntryDeath";
36-
}
18+
group Patient(source src: Patient, target tgtEntry) <<types>> {
19+
src -> tgtEntry.person = create("PersonTable") as newPerson then {
20+
src then Person(src, newPerson) "transformPerson";
21+
} "createPerson";
22+
src.address as srcAddress where use = 'home' and period.end.empty() -> tgtEntry.location = create("LocationTable") as newLocation then {
23+
srcAddress then Location(srcAddress, newLocation) "transformLocation";
24+
} "createLocation";
25+
src where deceased.is(System.DateTime) or deceased.is(System.Boolean) -> tgtEntry.death = create("DeathTable") as newDeath then {
26+
src then Death(src, newDeath) "transformDeath";
27+
} "createDeath";
28+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
map "https://aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOP" = "CoreFHIR2OMOP"
2+
3+
/// name = 'CoreFHIR2OMOP'
4+
/// title = 'FHIR resources to Tables CDM OMOP'
5+
/// description = 'Cette ressource présente les spécifications de l\'alignement entre les ressources FHIR vers les tables correspodantes du CDM OMOP.'
6+
7+
uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source
8+
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as source
9+
uses "https://aphp.fr/ig/fhir/dm/StructureDefinition/LogicalBundle" alias LogicalBundle as target
10+
11+
imports "https://aphp.fr/ig/fhir/dm/StructureMap/CoreFHIRPatient2OMOP"
12+
13+
group Bundle(source src: Bundle, target tgtBundle : LogicalBundle) <<types>> {
14+
src -> tgtBundle.id = uuid() "setId";
15+
src -> tgtBundle.type = 'transaction' "setType";
16+
src.entry as srcEntry where srcEntry.resource.is(FHIR.Patient) then {
17+
srcEntry.resource as srcResource -> (%srcResource.as(FHIR.Patient)) as srcPatient, tgtBundle.entry as newEntry then Patient(srcPatient, newEntry) "addPatient";
18+
} "entryLoop4Patient";
19+
}
20+
21+
group PatientTest(source src: Patient, target tgtBundle : LogicalBundle) {
22+
src -> tgtBundle.entry as newEntry then Patient(src, newEntry) "addPatient";
23+
}

0 commit comments

Comments
 (0)