Skip to content

Commit 75a53b9

Browse files
committed
fix: Rewrite profile example tests with demo-first structure
Restructure all four profile test files (R4 bodyweight, R4 BP, US Core bodyweight, US Core BP) to follow the demo-first pattern: readable demos on top, concise regression tests below.
1 parent f542501 commit 75a53b9

8 files changed

Lines changed: 483 additions & 589 deletions

File tree

examples/typescript-r4/__snapshots__/profile-bodyweight.test.ts.snap

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
// Bun Snapshot v1, https://bun.sh/docs/test/snapshots
22

3+
exports[`demo: create a bodyweight observation build a valid bodyweight resource step by step 1`] = `
4+
{
5+
"category": [
6+
{
7+
"coding": [
8+
{
9+
"code": "vital-signs",
10+
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
11+
},
12+
],
13+
},
14+
],
15+
"code": {
16+
"coding": [
17+
{
18+
"code": "29463-7",
19+
"system": "http://loinc.org",
20+
},
21+
],
22+
},
23+
"effectiveDateTime": "2024-06-15",
24+
"meta": {
25+
"profile": [
26+
"http://hl7.org/fhir/StructureDefinition/bodyweight",
27+
],
28+
},
29+
"resourceType": "Observation",
30+
"status": "final",
31+
"subject": {
32+
"reference": "Patient/pt-1",
33+
},
34+
"valueQuantity": {
35+
"code": "kg",
36+
"system": "http://unitsofmeasure.org",
37+
"unit": "kg",
38+
"value": 75,
39+
},
40+
}
41+
`;
42+
343
exports[`bodyweight profile creation fully populated resource matches snapshot 1`] = `
444
{
545
"category": [

examples/typescript-r4/__snapshots__/profile-bp.test.ts.snap

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Bun Snapshot v1, https://bun.sh/docs/test/snapshots
22

3-
exports[`blood pressure profile fully populated resource matches snapshot 1`] = `
3+
exports[`demo: create a blood pressure observation build a valid BP resource step by step 1`] = `
44
{
55
"category": [
66
{
@@ -10,7 +10,6 @@ exports[`blood pressure profile fully populated resource matches snapshot 1`] =
1010
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
1111
},
1212
],
13-
"text": "Vital Signs",
1413
},
1514
],
1615
"code": {
@@ -30,6 +29,8 @@ exports[`blood pressure profile fully populated resource matches snapshot 1`] =
3029
},
3130
},
3231
"valueQuantity": {
32+
"code": "mm[Hg]",
33+
"system": "http://unitsofmeasure.org",
3334
"unit": "mmHg",
3435
"value": 120,
3536
},
@@ -42,6 +43,8 @@ exports[`blood pressure profile fully populated resource matches snapshot 1`] =
4243
},
4344
},
4445
"valueQuantity": {
46+
"code": "mm[Hg]",
47+
"system": "http://unitsofmeasure.org",
4548
"unit": "mmHg",
4649
"value": 80,
4750
},
@@ -56,7 +59,7 @@ exports[`blood pressure profile fully populated resource matches snapshot 1`] =
5659
"resourceType": "Observation",
5760
"status": "final",
5861
"subject": {
59-
"reference": "Patient/pt-2",
62+
"reference": "Patient/pt-1",
6063
},
6164
}
6265
`;

0 commit comments

Comments
 (0)