Open orchardhillsdragon opened 5 years ago
HAPI FHIR parser cannot parser or encode elements alone, it has to be included a resource. Three options 1) Write our own FHIR parser 2) Check out HAPI FHIR parser to extend it 3) Build a wrapper on the HAPI FHIR parser by adding resource type header before parsing it and removing resource type header after encoding it.
The 3rd option is most cost-effective: 1) easier logic 2) less codes 3) easier to be extended or replaced by alternative later. 4) easier to maintain
Refer com.frt.fhir.parser.ResourceParser.java
Define mapping descriptor, refer to fhir-mapping.xml. The mapping descriptor 1) reduce mapping complexity 2) easier to implement and extend 3) easier to maintain
Redesign ResourceMapper, PatientResouceMapper and BaseMapper 1) from hapiPatient to frtPatient 2) from frtPatient to hapiPatient 3) BaseMapper shall only include generic function