Skip to content

Commit c0e1e19

Browse files
committed
Fix US Core examples: update slice method names to preserved casing
1 parent fbb4230 commit c0e1e19

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎examples/typescript-us-core/multi-profile-demo.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* 1. Creating observations with Body Weight and Body Height profiles
66
* 2. Using setters to apply profile-defined slices (no input needed for constant slices)
77
* 3. Using getters to read values:
8-
* - getVscat() - returns flat API (simplified, without discriminator)
9-
* - getVscatRaw() - returns full FHIR type (with discriminator)
8+
* - getVSCat() - returns flat API (simplified, without discriminator)
9+
* - getVSCatRaw() - returns full FHIR type (with discriminator)
1010
* 4. The override interface for type-safe cardinality constraints
1111
*/
1212

@@ -30,7 +30,7 @@ function createBodyWeightObservation(): Observation {
3030

3131
// Set the vital-signs category slice (auto-applies discriminator)
3232
// No input needed when all fields are part of the discriminator
33-
profile.setVscat();
33+
profile.setVSCat();
3434

3535
// Set additional required fields
3636
resource.code = {
@@ -54,7 +54,7 @@ function createBodyHeightObservation(): Observation {
5454
const profile = new usHeightProfile(resource);
5555

5656
// Set the vital-signs category slice
57-
profile.setVscat();
57+
profile.setVSCat();
5858

5959
// Set additional required fields
6060
resource.code = {
@@ -76,14 +76,14 @@ function createBodyHeightObservation(): Observation {
7676
function demonstrateGetters() {
7777
const resource = createBaseObservation();
7878
const profile = new usWeightProfile(resource);
79-
profile.setVscat();
79+
profile.setVSCat();
8080

8181
// Get simplified value (without discriminator) - flat API
82-
const simplified = profile.getVscat();
82+
const simplified = profile.getVSCat();
8383
console.log("Simplified slice:", simplified);
8484

8585
// Get raw value (with discriminator) - full FHIR type
86-
const raw = profile.getVscatRaw();
86+
const raw = profile.getVSCatRaw();
8787
console.log("Raw slice:", raw);
8888

8989
// The raw value includes the coding discriminator
@@ -98,7 +98,7 @@ function demonstrateTypeNarrowing() {
9898

9999
const resource = createBaseObservation();
100100
const profile = new usWeightProfile(resource);
101-
profile.setVscat();
101+
profile.setVSCat();
102102

103103
// TypeScript knows this is an Observation
104104
// The override interface ensures type safety for constrained fields

‎examples/typescript-us-core/multi-profile.test.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe("Multi-Profile Pattern", () => {
1111
describe("Body Weight Profile", () => {
1212
it("creates valid body weight observation", () => {
1313
const profile = new usWeightProfile(createObservation());
14-
profile.setVscat({});
14+
profile.setVSCat({});
1515

1616
const resource = profile.toResource();
1717
expect(resource.resourceType).toBe("Observation");
@@ -21,17 +21,17 @@ describe("Multi-Profile Pattern", () => {
2121

2222
it("has getters for slices", () => {
2323
const profile = new usWeightProfile(createObservation());
24-
profile.setVscat({});
24+
profile.setVSCat({});
2525

26-
const vscat = profile.getVscat();
26+
const vscat = profile.getVSCat();
2727
expect(vscat).toBeDefined();
2828
});
2929
});
3030

3131
describe("Body Height Profile", () => {
3232
it("creates valid body height observation", () => {
3333
const profile = new usHeightProfile(createObservation());
34-
profile.setVscat({});
34+
profile.setVSCat({});
3535

3636
const resource = profile.toResource();
3737
expect(resource.resourceType).toBe("Observation");
@@ -41,9 +41,9 @@ describe("Multi-Profile Pattern", () => {
4141

4242
it("has getters for slices", () => {
4343
const profile = new usHeightProfile(createObservation());
44-
profile.setVscat({});
44+
profile.setVSCat({});
4545

46-
const vscat = profile.getVscat();
46+
const vscat = profile.getVSCat();
4747
expect(vscat).toBeDefined();
4848
});
4949
});
@@ -59,7 +59,7 @@ describe("Multi-Profile Pattern", () => {
5959

6060
// Wrap with body weight profile
6161
const weightProfile = new usWeightProfile(baseObservation);
62-
weightProfile.setVscat({});
62+
weightProfile.setVSCat({});
6363

6464
const resource = weightProfile.toResource();
6565
expect(resource.status).toBe("final");
@@ -70,14 +70,14 @@ describe("Multi-Profile Pattern", () => {
7070
it("creates separate weight and height observations", () => {
7171
// Create weight observation
7272
const weightProfile = new usWeightProfile(createObservation());
73-
weightProfile.setVscat({});
73+
weightProfile.setVSCat({});
7474
const weightObs = weightProfile.toResource();
7575
weightObs.code = { coding: [{ system: "http://loinc.org", code: "29463-7", display: "Body Weight" }] };
7676
weightObs.valueQuantity = { value: 70, unit: "kg", system: "http://unitsofmeasure.org", code: "kg" };
7777

7878
// Create height observation
7979
const heightProfile = new usHeightProfile(createObservation());
80-
heightProfile.setVscat({});
80+
heightProfile.setVSCat({});
8181
const heightObs = heightProfile.toResource();
8282
heightObs.code = { coding: [{ system: "http://loinc.org", code: "8302-2", display: "Body Height" }] };
8383
heightObs.valueQuantity = { value: 175, unit: "cm", system: "http://unitsofmeasure.org", code: "cm" };

‎examples/typescript-us-core/profile-demo.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function createBloodPressureExample(): Observation {
8585
const USCoreBloodPressureProfileProfile = new usBpProfile({ resourceType: "Observation" } as Observation);
8686

8787
// Use fluent API to set slices - discriminator values are auto-applied
88-
USCoreBloodPressureProfileProfile.setVscat()
88+
USCoreBloodPressureProfileProfile.setVSCat()
8989
.setSystolic({
9090
// The code for systolic (8480-6) is auto-applied by the profile
9191
valueQuantity: {

0 commit comments

Comments
 (0)