1

I am trying to map xml cda document to Fhir resources using structureMap resource. Here is structureMap resource which I programmed:

 StructureMap structureMap = new StructureMap();   
       StructureMapGroupComponent  group = new StructureMapGroupComponent();
       StructureMapGroupInputComponent input = new StructureMapGroupInputComponent() ;

       List<StructureMapStructureComponent> structureList =new ArrayList<StructureMapStructureComponent>();
       StructureMapStructureComponent structure =  new StructureMapStructureComponent();
       StructureMapStructureComponent structure2 =  new StructureMapStructureComponent();
       structure.setUrl("C:\\Users\\a_nas\\Desktop\\Master-Arbeit\\Beispieldokumente_2.06.1\\patient.xml");
       structure.setMode(StructureMapModelMode.SOURCE);
       structure2.setUrl("http://hl7.org/fhir/StructureDefinition/patient");       
       structure2.setMode(StructureMapModelMode.TARGET);

       structureList.add(structure);
       structureList.add(structure2);
       structureMap.setStructure(structureList);
       input.setName("patient");
       input.setMode(StructureMapInputMode.SOURCE);
       input.setDocumentation("PatientElgaToFhir");
       group.addInput(input);
       StructureMapGroupRuleComponent rule = new StructureMapGroupRuleComponent() ;
       rule.setName("rule1");
       StructureMapGroupRuleSourceComponent ruleSource = new StructureMapGroupRuleSourceComponent() ;
       List<StructureMapGroupRuleSourceComponent> rulList = new ArrayList<StructureMapGroupRuleSourceComponent>();
       ruleSource.setContext("source");
       ruleSource.setElement("birthTime");

       StructureMapGroupRuleTargetComponent ruleTarget = new StructureMapGroupRuleTargetComponent();
       ruleTarget.setContext("target");
       ruleTarget.setElement("BirthDate");
       ruleTarget.setTransform(StructureMapTransform.COPY);
       rule.addSource(ruleSource);
       rule.addTarget(ruleTarget);
       group.addRule(rule);

       structureMap.addGroup(group);

But I can not find any way to link my defined structureMap resource to corresponding FHIR resources. Actually i don't know how to use this structureMap and get a fhir resource. Could you please help me?

Sohrab
  • 1,348
  • 4
  • 13
  • 33
  • Hi, I do not have experience on hapi-Fhir StructureMap, but to transform a CDA to some of the FHIR Document Resources (Composition,DocumentReference,DocumentManifest) why not using XSLT? I guess it is an efficient an simple mechanism. – Marti Pàmies Solà Jan 29 '18 at 07:27
  • thanks for your answer.have you any example for using XSLT? any tutorial? – Sohrab Jan 29 '18 at 09:00
  • has any one an example for using FHIR StructureMapUtilities ?I will be grateful. – Sohrab Jan 29 '18 at 12:59
  • 1
    Have a look at https://github.com/srdc/cda2fhir - It seems like a fair place to start. You could use that to embed inside a StructureMap operation – jkiddo May 06 '18 at 06:23

0 Answers0