use of org.hl7.fhir.r5.model.IntegerType in project bunsen by cerner.
the class TestData method newPatient.
/**
* Returns a FHIR Patient for testing purposes.
*/
public static Patient newPatient() {
Patient patient = new Patient();
patient.setId("test-patient");
patient.setMultipleBirth(new IntegerType(1));
return patient;
}
use of org.hl7.fhir.r5.model.IntegerType in project kindling by HL7.
the class SpreadSheetReloader method parseStatus.
private void parseStatus(DomainResource ed, String value) {
ed.getExtension().removeIf(ext -> ext.getUrl().equals(BuildExtensions.EXT_FMM_LEVEL));
ed.getExtension().removeIf(ext -> ext.getUrl().equals(BuildExtensions.EXT_STANDARDS_STATUS));
ed.getExtension().removeIf(ext -> ext.getUrl().equals(BuildExtensions.EXT_NORMATIVE_VERSION));
if (!Utilities.noString(value) && value.contains("/")) {
String[] p = value.split("\\/");
if (Utilities.noString(p[0].trim())) {
ed.getExtension().removeIf(ext -> ext.getUrl().equals(BuildExtensions.EXT_FMM_LEVEL));
} else {
ed.addExtension(BuildExtensions.EXT_FMM_LEVEL, new IntegerType(p[0]));
}
if (p[1].contains(";")) {
ed.addExtension(BuildExtensions.EXT_STANDARDS_STATUS, new CodeType(p[1].substring(0, p[1].indexOf(";"))));
ed.addExtension(BuildExtensions.EXT_NORMATIVE_VERSION, new CodeType(p[1].substring(p[1].indexOf("from=") + 5)));
} else {
ed.addExtension(BuildExtensions.EXT_STANDARDS_STATUS, new CodeType(p[1]));
}
}
sortExtensions(ed);
}
use of org.hl7.fhir.r5.model.IntegerType in project kindling by HL7.
the class Regenerator method generateOperation.
private void generateOperation(String root, ResourceDefn r, Operation op) throws IOException {
OperationDefinition opd = op.getResource().copy();
opd.setId(r.getName() + "-" + op.getName());
opd.setUrl("http://hl7.org/fhir/build/OperationDefinition/" + opd.getId());
if (!Utilities.noString(op.getFooter())) {
opd.addExtension(BuildExtensions.EXT_FOOTER, new MarkdownType(op.getFooter()));
}
if (!Utilities.noString(op.getFooter2())) {
opd.addExtension(BuildExtensions.EXT_FOOTER2, new MarkdownType(op.getFooter2()));
}
for (OperationExample opex : op.getExamples()) {
Extension ex = new Extension(BuildExtensions.EXT_OP_EXAMPLE);
if (!Utilities.noString(opex.getContent())) {
ex.addExtension(BuildExtensions.EXT_OP_EXAMPLE_CONTENT, new StringType(opex.getContent()));
}
if (!Utilities.noString(opex.getComment())) {
ex.addExtension(BuildExtensions.EXT_OP_EXAMPLE_COMMENT, new StringType(opex.getComment()));
}
ex.addExtension(BuildExtensions.EXT_OP_EXAMPLE_RESPONSE, new BooleanType(opex.isResponse()));
ex.addExtension(BuildExtensions.EXT_OP_EXAMPLE_LIST, new IntegerType(1));
opd.addExtension(ex);
}
for (OperationExample opex : op.getExamples2()) {
Extension ex = new Extension(BuildExtensions.EXT_OP_EXAMPLE);
if (!Utilities.noString(opex.getContent())) {
ex.addExtension(BuildExtensions.EXT_OP_EXAMPLE_CONTENT, new StringType(opex.getContent()));
}
if (!Utilities.noString(opex.getComment())) {
ex.addExtension(BuildExtensions.EXT_OP_EXAMPLE_COMMENT, new StringType(opex.getComment()));
}
ex.addExtension(BuildExtensions.EXT_OP_EXAMPLE_RESPONSE, new BooleanType(opex.isResponse()));
ex.addExtension(BuildExtensions.EXT_OP_EXAMPLE_LIST, new IntegerType(2));
opd.addExtension(ex);
}
File fn = new File(Utilities.path(root, opd.fhirType().toLowerCase() + "-" + opd.getId() + ".gen.xml"));
new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(fn), opd);
fn.setLastModified(r.getTimestamp());
}
use of org.hl7.fhir.r5.model.IntegerType in project kindling by HL7.
the class ProfileGenerator method addSpecificDetails.
private void addSpecificDetails(PrimitiveType type, ElementDefinition ed) throws FHIRFormatError {
if (type.getCode().equals("integer")) {
ed.setMinValue(new IntegerType(-2147483648));
ed.setMaxValue(new IntegerType(2147483647));
}
if (type.getCode().equals("integer64")) {
ed.setMinValue(new Integer64Type(-9223372036854775808L));
ed.setMaxValue(new Integer64Type(9223372036854775807L));
}
if (type.getCode().equals("string")) {
ed.setMaxLength(1024 * 1024);
}
}
use of org.hl7.fhir.r5.model.IntegerType in project bunsen by cerner.
the class TestData method newPatient.
/**
* Returns a FHIR Patient for testing purposes.
*/
public static Patient newPatient() {
Patient patient = new Patient();
patient.setId("test-patient");
patient.setMultipleBirth(new IntegerType(1));
return patient;
}
Aggregations