-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgenerate-types.ts
More file actions
32 lines (30 loc) · 1.02 KB
/
generate-types.ts
File metadata and controls
32 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { APIBuilder } from "../src/api/builder";
const builder = new APIBuilder()
.throwException()
.fromPackage("hl7.fhir.r4.core", "4.0.1")
.typeSchema({
treeShake: {
"hl7.fhir.r4.core": {
"http://hl7.org/fhir/StructureDefinition/CodeSystem": {},
"http://hl7.org/fhir/StructureDefinition/StructureDefinition": {},
"http://hl7.org/fhir/StructureDefinition/ValueSet": {},
"http://hl7.org/fhir/StructureDefinition/Extension": {
selectFields: ["url", "valueUri", "valueCode"],
},
},
},
})
.typescript({
withDebugComment: false,
generateProfile: false,
primitiveTypeExtension: false,
})
.outputTo("./src/fhir-types")
.cleanOutput(true);
const report = await builder.generate();
if (report.success) {
console.log("✅ FHIR types generated successfully!");
} else {
console.error("❌ FHIR types generation failed.");
process.exit(1);
}