Stream: implementers
Topic: I need help
Luis EC (May 06 2019 at 18:20):
good morning, I have a question I am trying to create an electronic clinical file CDA (R2) like the one in that link http://hl7.org/implement/standards/fhir/patient-mappings.html
I currently carry the following as soon as I am learning
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum;
import ca.uhn.fhir.model.dstu2.valueset.ContactPointUseEnum;
import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.client.api.IGenericClient;
public class CrearPaciente {
public void main() {
FhirContext ctx = FhirContext.forDstu2();
String serverBase = "http://localhost:8080/baseDstu2/";
IGenericClient client = ctx.newRestfulGenericClient(serverBase);
//orden CDA(R2)
//http://hl7.org/implement/standards/fhir/patient-mappings.html
Patient patient = new Patient();
patient.addIdentifier().setSystem("urn:system").setValue("12345");
patient.setActive(true);
patient.addName().addFamily("Smith").addGiven("John").setUse(NameUseEnum.OFFICIAL);
patient.addTelecom().setSystem(ContactPointSystemEnum.PHONE).setValue("123456789").setUse(ContactPointUseEnum.HOME);
patient.addTelecom().setUse(ContactPointUseEnum.WORK).setSystem(ContactPointSystemEnum.PHONE).setValue("000000000");
patient.setGender(AdministrativeGenderEnum.MALE);
patient.setBirthDate(new DateDt("2001-01-01"));
patient.setDeceased(new BooleanDt(false));
patient.addAddress().setCountry("Mexico").setState("Tamaulipas").setCity("cd victoria").setDistrict("cinvestav").setPostalCode("17830");
patient.setMaritalStatus(MaritalStatusCodesEnum.UNMARRIED);
patient.setMultipleBirth(null);//parto multiple //patient.addPhoto(); patient.addContact().addRelationship() .addCoding().setCode("01").setDisplay("Spouse") .setSystem("http://hl7.org.uk/fhir/ValueSet/CareConnect-PersonRelationshipType").setElementSpecificId("123456789");; patient.setCommunication(null); //patient.setManagingOrganization(null); // Invoke the server create method (and send pretty-printed JSON // encoding to the server // instead of the default which is non-pretty printed XML) MethodOutcome outcome = client.create() .resource(patient) .prettyPrint() .encodedJson() .execute(); }
}
Lloyd McKenzie (May 06 2019 at 18:38):
I don't see a question?
Luis EC (May 06 2019 at 18:42):
How do I create the cda structure according to what is marked?
Lloyd McKenzie (May 06 2019 at 18:56):
So you know that this isn't a mechanism to create CDA instances? It's to create FHIR instances - which is a totally different standard.
Stefan Lang (May 06 2019 at 18:57):
You might want to have a look at MDHT (model driven health tools) if you need to implement CDA
Luis EC (May 06 2019 at 19:02):
I am new to all this, try to look for examples but I have not seen any in order to have something of reference
Yunwei Wang (May 06 2019 at 19:09):
What do you want to achieve?
Luis EC (May 06 2019 at 19:10):
just create a clinical file
Lloyd McKenzie (May 06 2019 at 19:46):
A CDA clinical file or a FHIR clinical file?
Luis EC (May 06 2019 at 19:47):
I'm trying to generate a file with java, my problem is the code in java
Lloyd McKenzie (May 06 2019 at 19:52):
Right, but what kind of a file are you trying to create? You said CDA, but you're using Java that produces FHIR.
Yunwei Wang (May 06 2019 at 19:56):
@Luis EC There are different type of clinical file. CDA is one. FHIR is another one.
Luis EC (May 06 2019 at 19:57):
What should I use to create a file with java? I was using hapi because it has servers to do tests.
Last updated: Apr 12 2022 at 19:14 UTC