Closed YasiAap closed 4 years ago
even I copied your code exactly , and only with a little change as following:
` // Create a Patient
Patient pat = new Patient();
pat.addName().addFamily("Simpson").addGiven("Homer").addGiven("J");
pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135");
// pat.addIdentifier().setLabel("Library Card 12345").setValue("12345");
pat.addTelecom().setUse(ContactPointUseEnum.HOME).setSystem(ContactPointSystemEnum.PHONE).setValue("1 (416) 340-4800");
pat.setGender(AdministrativeGenderEnum.MALE);
// Create a context
FhirContext ctx = new FhirContext();
// Create a XML parser
IParser parser = ctx.newXmlParser();
parser.setPrettyPrint(true);
String encode = parser.encodeResourceToString(pat);
System.out.println(encode);`
I use dstu2 instead of dstu in the sample. But again I face an error said : ca.uhn.fhir.context.ConfigurationException: Unknown class[ca.uhn.fhir.model.primitive.XhtmlDt] for data type definition: xhtml
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi James!
I have a problem which I don't know how to solve it. I am developing an application using android Studio. I have added three following HAPI FHIR Jar files libs folder of the app: (hapi-fhir-android-1.5 , hapi-fhir-base-1.5 , hapi-fhir-structures-dstu2-1.5)
and here is piece code I've written to create a simple Patient Resource: ` Patient patient = new Patient(); HumanNameDt na=patient.addName(); na.addFamily(lName).addGiven(fName);
following is the error I face:
Can you tell me what is the problem? and how can I solve it?