Skip to content

Commit fe6f602

Browse files
merged
1 parent b2b5497 commit fe6f602

18 files changed

Lines changed: 628 additions & 3777 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { APIBuilder, mkCodegenLogger, prettyReport } from "../../src";
2+
3+
console.log("📦 Generating FHIR R4 Core Types...");
4+
5+
const logger = mkCodegenLogger({
6+
prefix: "API",
7+
suppressTags: ["#fieldTypeNotFound", "#largeValueSet"],
8+
});
9+
10+
const builder = new APIBuilder({ logger })
11+
.throwException()
12+
.fromPackage("hl7.fhir.r4.core", "4.0.1")
13+
.python({
14+
allowExtraFields: false,
15+
primitiveTypeExtension: true,
16+
generateProfile: true,
17+
fhirpyClient: false,
18+
fieldFormat: "snake_case",
19+
})
20+
.typeSchema({
21+
treeShake: {
22+
"hl7.fhir.r4.core": {
23+
"http://hl7.org/fhir/StructureDefinition/Bundle": {},
24+
"http://hl7.org/fhir/StructureDefinition/OperationOutcome": {},
25+
"http://hl7.org/fhir/StructureDefinition/DomainResource": {},
26+
"http://hl7.org/fhir/StructureDefinition/BackboneElement": {},
27+
"http://hl7.org/fhir/StructureDefinition/Element": {},
28+
"http://hl7.org/fhir/StructureDefinition/Patient": {},
29+
"http://hl7.org/fhir/StructureDefinition/Observation": {},
30+
"http://hl7.org/fhir/StructureDefinition/bodyweight": {},
31+
// Extensions
32+
"http://hl7.org/fhir/StructureDefinition/patient-birthPlace": {},
33+
"http://hl7.org/fhir/StructureDefinition/patient-nationality": {},
34+
"http://hl7.org/fhir/StructureDefinition/humanname-own-prefix": {},
35+
"http://hl7.org/fhir/StructureDefinition/patient-birthTime": {},
36+
},
37+
},
38+
})
39+
.outputTo("./examples/python-extension-example/fhir_types")
40+
.cleanOutput(true);
41+
42+
const report = await builder.generate();
43+
44+
console.log(prettyReport(report));
45+
46+
if (!report.success) {
47+
process.exit(1);
48+
}

examples/python/fhir_types/README.md

Lines changed: 0 additions & 2587 deletions
This file was deleted.

examples/python/fhir_types/__init__.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

examples/python/fhir_types/hl7_fhir_r4_core/__init__.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)