Stream: hapi
Topic: Extensions, Java, ValueCode
Zak Guler (Jun 23 2020 at 15:55):
I'd like to create extension with URL and a valueCode instead of a valueString:
new Extension("http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex").setValue("F");
will generate:
{ "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
"valueString": "F"
}
but I actually need to generte the json with valueCode:
{ "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
"valueCode": "F"
}
any help on how to do this?
thanx
Zak
Zak Guler (Jun 23 2020 at 17:56):
found the answer:
.setUrl("http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex"").setValue(new CodeType("F"));
Last updated: Apr 12 2022 at 19:14 UTC