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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
//! Parse FHIR R5 specifications JSON file.
//!
//! For an example see the sibling file of JSON.
use crate::r5::parse::all::*;
use crate::r5::parse::concept_maps::*;
use ::serde::{Deserialize, Serialize};
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
#[serde(deny_unknown_fields)]
pub struct Resource {
/// # meta
///
/// ## Description
///
/// The `meta` attribute contains metadata about a FHIR resource that is
/// maintained by the infrastructure. It provides information about the
/// resource's versioning, last modification, security labels, profiles, and
/// tags in FHIR R5.
///
/// ## Purpose
///
/// The `meta` element serves to:
/// - Track resource versioning and modification history
/// - Specify which profiles the resource claims to conform to
/// - Apply security labels and access control information
/// - Provide tags for categorization and workflow management
/// - Enable optimistic locking through version control
/// - Support provenance and audit requirements
///
/// ## Usage
///
/// Use the `meta` attribute to:
/// - Track when resources were last updated
/// - Specify profile conformance for validation
/// - Apply security classifications to resources
/// - Tag resources for workflow or categorization purposes
/// - Enable version-aware updates and conflict detection
/// - Support system-level metadata requirements
///
/// The `meta` element is typically managed by the server infrastructure,
/// though clients may provide some elements.
///
/// ## Data Type
///
/// **Meta** - A complex data type containing the following optional
/// sub-elements:
/// - `versionId`: string - Version identifier for the resource
/// - `lastUpdated`: instant - When the resource was last updated
/// - `source`: uri - Identifies where the resource came from
/// - `profile`: array of canonical URIs - Profiles this resource claims to
/// conform to
/// - `security`: array of Coding - Security labels applied to the resource
/// - `tag`: array of Coding - Tags applied to the resource for
/// categorization
///
/// ## Constraints
///
/// - **Required**: No - The entire `meta` element is optional
/// - **Cardinality**: 0..1 (zero to one occurrence)
/// - **Server Managed**: Most sub-elements are controlled by the server
/// - **versionId**: Must change when resource content changes
/// - **lastUpdated**: Must be updated when resource content changes
/// - **profile**: Must reference valid StructureDefinition resources
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete Practitioner
/// resource demonstrating comprehensive use of the `meta` attribute.
///
/// ## Related Keys
///
/// - `id` - Resource identifier that the meta information describes
/// - `resourceType` - Resource type that determines applicable profiles
/// - `extension` - May contain additional metadata not covered by meta
/// - Bundle entries use `meta` for version control during transactions
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details on metadata
/// management, versioning, and security labeling, refer to the official
/// FHIR R5 documentation.
///
pub meta: Option<Meta>,
/// # resourceType
///
/// ## Description
///
/// The `resourceType` attribute specifies the type of FHIR resource being
/// represented. It is a mandatory element that identifies which resource
/// schema and constraints apply to the JSON document in FHIR R5.
///
/// ## Purpose
///
/// The `resourceType` serves several critical functions:
///
/// - Identifies the specific FHIR resource type for parsers and processors
/// - Determines which validation rules and constraints apply
/// - Enables proper routing and processing in FHIR systems
/// - Provides context for interpreting the resource's data elements
/// - Supports polymorphism in FHIR resource handling
///
/// ## Usage
///
/// The `resourceType` must be included in every FHIR resource as the first
/// element. It should be used:
///
/// - At the root level of every FHIR resource JSON document
/// - When validating resources against their appropriate
/// StructureDefinitions
/// - In API endpoints to determine resource-specific processing logic
/// - For content negotiation and resource type filtering
///
/// ## Data Type
///
/// **code** - A string that must exactly match one of the defined FHIR
/// resource types. The value is:
///
/// - Case-sensitive
/// - Must be an exact match to a valid FHIR R5 resource type name
/// - Follows PascalCase naming convention (e.g., "Patient", "Observation",
/// "DiagnosticReport")
///
/// ## Constraints
///
/// - **Required**: Yes - Must be present in every FHIR resource
/// - **Cardinality**: 1..1 (exactly one occurrence)
/// - **Fixed Position**: Must be the first element in the JSON object
/// - **Valid Values**: Must be one of the 150+ defined FHIR R5 resource
/// types
/// - **Case Sensitivity**: Exact case match required
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete Observation
/// resource demonstrating the use of the `resourceType` attribute.
///
/// ## Related Keys
///
/// - `meta.profile` - Specifies which profile(s) the resource conforms to
/// - `id` - Unique identifier for the resource instance
/// - `meta` - Metadata about the resource
/// - All resource-specific elements depend on the `resourceType` for their
/// validity
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details and the full list
/// of valid resource types, refer to the official FHIR R5 documentation for
/// resource definitions.
///
pub resource_type: String,
/// # id
///
/// ## Description
///
/// The `id` attribute is the logical identifier for a FHIR resource within
/// a given context. It uniquely identifies the resource and is used for
/// resource addressing and referencing within FHIR R5.
///
/// ## Purpose
///
/// The `id` exists to provide a unique identifier for each FHIR resource
/// instance. This identifier is essential for:
///
/// - Resource addressing via RESTful URLs
/// - Creating references between resources
/// - Version control and resource tracking
/// - Enabling resource updates and deletions
///
/// ## Usage
///
/// Use the `id` attribute when:
///
/// - Creating a new resource that needs to be uniquely identifiable
/// - Referencing a resource from another resource
/// - Performing CRUD operations on existing resources
/// - Building RESTful FHIR APIs
///
/// The `id` is typically assigned by the server when a resource is created,
/// but can be provided by the client in some scenarios.
///
/// ## Data Type
///
/// **string** - A sequence of Unicode characters with the following
/// constraints:
///
/// - Must be between 1 and 64 characters in length
/// - Can contain letters (A-Z, a-z), digits (0-9), hyphens (-), and periods
/// (.)
/// - Must start and end with an alphanumeric character
/// - Case sensitive
///
/// ## Constraints
///
/// - **Required**: No - The `id` is optional for resource creation but
/// typically assigned by servers
/// - **Cardinality**: 0..1 (zero to one occurrence)
/// - **Length**: 1-64 characters
/// - **Pattern**: Must match the regex `[A-Za-z0-9\-\.]{1,64}`
/// - **Uniqueness**: Must be unique within the context of the resource type
/// on a given server
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete Patient resource
/// demonstrating the use of the `id` attribute.
///
/// ## Related Keys
///
/// - `meta.versionId` - Version identifier for the resource instance
/// - `identifier` - Business identifiers for the resource
/// - `fullUrl` - Absolute URL when used in bundles
/// - `reference` - Used to reference this resource from other resources
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for resource identity and addressing.
///
pub id: String,
/// # text
///
/// ## Description
///
/// The `text` attribute provides a human-readable narrative summary of a
/// FHIR resource's content in XHTML format. This narrative serves as a
/// fallback representation that ensures the essential information remains
/// accessible even when systems cannot process all the structured data
/// elements. The text element is particularly important for clinical
/// safety, regulatory compliance, and systems interoperability where human
/// readability is required.
///
/// ## Purpose
///
/// The `text` exists to:
///
/// - Provide human-readable summaries of structured resource content
/// - Ensure clinical information remains accessible when structured data
/// cannot be processed
/// - Support regulatory requirements for human-readable clinical documents
/// - Enable fallback display when rendering systems have limited
/// capabilities
/// - Provide narrative context that complements structured data
/// - Support clinical safety by ensuring critical information is always
/// readable
/// - Enable content review and validation by healthcare professionals
///
/// ## Usage
///
/// Use the `text` attribute when:
///
/// - Creating clinical resources that require human-readable summaries
/// - Supporting regulatory compliance for clinical documentation
/// - Ensuring accessibility across diverse healthcare systems
/// - Providing narrative context for complex structured data
/// - Creating resources for patient-facing applications
/// - Supporting clinical review workflows that need readable content
/// - Implementing systems that require both structured and narrative
/// representations
///
/// The narrative should accurately summarize the key information from the
/// structured elements.
///
/// ## Data Type
///
/// **Narrative** - A complex structure containing:
///
/// - `status` (code): The generation status of the narrative
/// (generated|extensions|additional|empty)
/// - `div` (xhtml): The XHTML content of the narrative
///
/// **Status Values:**
///
/// - `generated`: Generated from structured data, no additional information
/// - `extensions`: Generated from structured data with additional extension
/// content
/// - `additional`: Contains additional information not in structured data
/// - `empty`: No narrative content provided
///
/// ## Constraints
///
/// - **Required**: Optional but strongly recommended for most clinical
/// resources
/// - **Cardinality**: 0..1 (at most one narrative per resource)
/// - **XHTML Format**: The div element must contain valid XHTML content
/// - **Safety**: Should include all critical information from structured
/// data
/// - **Consistency**: Should accurately reflect the structured data content
/// - **Language**: Should match the language specified in the resource
/// - **Security**: XHTML content must be safe and not contain executable
/// scripts
///
/// ## Examples
///
/// See the accompanying `example.json` file for complete resources
/// demonstrating text narratives for different resource types including
/// clinical observations, medications, and patient information.
///
/// ## Related Keys
///
/// - `div` - The XHTML content portion of the narrative
/// - `status` - Indicates how the narrative was generated and its
/// relationship to structured data
/// - `language` - Language code that may affect narrative content
/// - `meta` - Resource metadata that may influence narrative generation
/// - `contained` - Inline resources that may be referenced in the narrative
/// - `extension` - Extensions that may be included in "extensions" status
/// narratives
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for Narrative data type and narrative
/// generation requirements.
///
pub text: Option<::serde_json::Value>,
/// # url
///
/// ## Description
///
/// The `url` attribute represents the canonical URL that uniquely
/// identifies a FHIR resource such as a StructureDefinition, ValueSet,
/// CodeSystem, or CapabilityStatement. This URL serves as a global
/// identifier that remains constant across different versions of the
/// resource and provides a stable reference for external systems to
/// identify and reference the resource.
///
/// ## Purpose
///
/// The `url` exists to provide a globally unique, version-independent
/// identifier for FHIR resources. This enables:
///
/// - Stable referencing of resources across different FHIR implementations
/// - Version management while maintaining resource identity
/// - Canonical identification for resource dependencies and imports
/// - Support for resource discovery and resolution mechanisms
/// - Consistent resource identification in distributed healthcare networks
///
/// ## Usage
///
/// Use the `url` attribute when:
///
/// - Defining canonical resources like StructureDefinitions, ValueSets, or
/// CodeSystems
/// - Creating stable references that persist across resource versions
/// - Implementing resource registries or repositories
/// - Supporting resource discovery and dependency resolution
/// - Establishing canonical URLs for organizational FHIR artifacts
///
/// The `url` should follow URI format conventions and be resolvable when
/// possible to aid in resource discovery.
///
/// ## Data Type
///
/// **uri** - A Uniform Resource Identifier following RFC 3986:
/// - Must be an absolute URI with scheme (typically http or https)
/// - Should be unique globally to avoid conflicts
/// - Recommended to use organization's domain for uniqueness
/// - May include path components to organize related resources
/// - Should remain stable even as resource content evolves
///
/// ## Constraints
///
/// - **Required**: Yes for canonical resources (StructureDefinition,
/// ValueSet, CodeSystem, etc.)
/// - **Cardinality**: 1..1 (exactly one occurrence when present)
/// - **Format**: Must be a valid absolute URI
/// - **Uniqueness**: Should be globally unique within the resource type
/// - **Stability**: Should remain constant across resource versions
/// - **Resolvability**: Should ideally be resolvable to the actual resource
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete
/// StructureDefinition resource demonstrating the canonical URL usage in
/// various contexts.
///
/// ## Related Keys
///
/// - `version` - Business version that works with url to create
/// version-specific references
/// - `name` - Machine-readable name often derived from the url path
/// - `identifier` - Additional identifiers that may complement the
/// canonical url
/// - `baseDefinition` - References other resources using their canonical
/// urls
/// - `derivation` - Indicates relationship to base definitions via their
/// urls
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for canonical resource types and the
/// canonical URI data type definition.
///
pub url: String,
/// # version
///
/// ## Description
///
/// The `version` attribute represents the business version identifier of a
/// FHIR resource, particularly for canonical resources like
/// StructureDefinitions, ValueSets, CodeSystems, and CapabilityStatements.
/// This version works in conjunction with the canonical `url` to provide
/// precise, version-specific identification of resources. Unlike technical
/// versioning (like `meta.versionId`), the business version reflects
/// meaningful changes in the resource's content, semantics, or clinical
/// significance.
///
/// ## Purpose
///
/// The `version` exists to support:
///
/// - Business-level versioning that reflects meaningful content changes
/// - Version-specific resource references and dependencies
/// - Change management and compatibility tracking across resource evolution
/// - Support for multiple concurrent versions of the same conceptual
/// resource
/// - Implementation guidance for version compatibility and migration
/// - Regulatory and compliance requirements for versioned healthcare
/// standards
///
/// ## Usage
///
/// Use the `version` attribute when:
///
/// - Publishing canonical resources that may evolve over time
/// - Supporting multiple concurrent versions of clinical standards
/// - Implementing version-aware resource resolution and validation
/// - Managing dependencies between versioned FHIR artifacts
/// - Providing clear change tracking for clinical decision support rules
/// - Supporting regulatory requirements for versioned healthcare content
///
/// Version values should follow semantic versioning principles where
/// appropriate, using formats like "1.0.0" or "2024.1" depending on
/// organizational conventions.
///
/// ## Data Type
///
/// **string** - A human-readable version identifier:
///
/// - Commonly follows semantic versioning (e.g., "1.0.0", "2.1.3")
/// - May use date-based versioning (e.g., "2024.08", "20240815")
/// - Can include pre-release indicators (e.g., "1.0.0-beta", "2.0.0-rc1")
/// - Should be consistently formatted within an organization
/// - Must be comparable to determine version precedence
/// - Should reflect the significance of changes between versions
///
/// ## Constraints
///
/// - **Required**: Optional for most resources, strongly recommended for
/// canonical resources
/// - **Cardinality**: 0..1 (at most one occurrence)
/// - **Format**: No strict format requirements, but should be consistent
/// and comparable
/// - **Uniqueness**: Should be unique within the context of the same
/// canonical URL
/// - **Ordering**: Should allow for logical ordering and comparison of
/// versions
/// - **Stability**: Should not change once a version is published and in
/// use
///
/// ## Examples
///
/// See the accompanying `example.json` file for complete examples
/// demonstrating version usage in StructureDefinition, ValueSet, and
/// CapabilityStatement resources with different versioning approaches.
///
/// ## Related Keys
///
/// - `url` - Canonical identifier that works with version to provide
/// precise resource identification
/// - `name` - Machine-readable identifier that may reflect version in its
/// naming
/// - `title` - Human-readable title that may include version information
/// for clarity
/// - `status` - Indicates lifecycle status which relates to version
/// maturity
/// - `date` - Publication date that often corresponds to version release
/// date
/// - `publisher` - Entity responsible for version management and release
/// - `experimental` - Flag indicating if this version is still experimental
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for canonical resource types and
/// versioning guidelines in the FHIR specification.
///
pub version: String,
/// # name
///
/// ## Description
///
/// The `name` attribute represents a human-readable identifier or label
/// used throughout FHIR R5 resources to provide meaningful, user-friendly
/// text for various elements. It serves as the primary textual identifier
/// that humans use to recognize, reference, and work with healthcare
/// concepts, entities, and data elements.
///
/// ## Purpose
///
/// The `name` exists to provide human-readable identification across FHIR
/// resources, enabling:
///
/// - User-friendly display of resource information
/// - Searchable and recognizable labels for healthcare entities
/// - Support for multiple naming conventions and languages
/// - Clear identification in user interfaces and documentation
/// - Meaningful references in clinical workflows and communications
///
/// ## Usage
///
/// Use the `name` attribute when:
///
/// - Defining patient names with proper structure (family, given names)
/// - Naming healthcare providers, organizations, and facilities
/// - Labeling medication and substance names
/// - Creating human-readable identifiers for plans and protocols
/// - Providing searchable names for locations and services
/// - Establishing clear references for coded concepts
///
/// Names should be accurate, culturally appropriate, and suitable for the
/// intended use context.
///
/// ## Data Type
///
/// **varies by context** - Common patterns include:
///
/// - **HumanName** - Structured representation for person names (family,
/// given, prefix, suffix)
/// - **string** - Simple text name for organizations, medications, and
/// other entities
/// - **Array of HumanName** - Multiple name representations with different
/// uses
/// - **Complex structures** - May include use codes, periods of validity,
/// and preferred flags
///
/// ## Constraints
///
/// - **Required**: Conditional - often required for key identifying
/// elements
/// - **Cardinality**: Varies by context (0..1, 0..*, or 1..1)
/// - **Format**: Should follow cultural and linguistic conventions
/// - **Validation**: May include format checking for structured names
/// - **Uniqueness**: Not required to be unique across systems
///
/// ## Examples
///
/// See the accompanying `example.json` file for a comprehensive example
/// showing various `name` attribute uses across different FHIR resources
/// and contexts.
///
/// ## Related Keys
///
/// - `family` - Family name component in HumanName structures
/// - `given` - Given name components in HumanName structures
/// - `use` - Context or purpose of the name (official, usual, nickname)
/// - `text` - Complete name as a single string
/// - `period` - Time period when the name was/is in use
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for HumanName data types, naming
/// conventions, and context-specific name requirements.
///
pub name: Option<String>,
/// # title
///
/// ## Description
///
/// The `title` attribute provides a human-readable, descriptive name for a
/// FHIR resource that is intended for display to end users. Unlike the
/// `name` attribute which is machine-readable and constrained to specific
/// naming conventions, the `title` serves as a user-friendly label that can
/// include spaces, punctuation, and formatting that makes it more
/// accessible to healthcare professionals and patients.
///
/// ## Purpose
///
/// The `title` exists to provide a clear, descriptive display name that:
///
/// - Offers immediate recognition and understanding for human users
/// - Supports user interface display requirements with formatted text
/// - Provides context and meaning beyond technical identifiers
/// - Enables better user experience in clinical applications
/// - Supports internationalization and localization needs
/// - Complements machine-readable names with human-readable descriptions
///
/// ## Usage
///
/// Use the `title` attribute when:
///
/// - Creating resources that will be displayed in user interfaces
/// - Providing descriptive names for StructureDefinitions, ValueSets, or
/// CodeSystems
/// - Supporting clinical decision support tools that need clear labels
/// - Implementing patient-facing applications requiring readable names
/// - Creating documentation or reports that need descriptive resource names
/// - Building applications that require both technical and display names
///
/// The `title` should be concise but descriptive, avoiding overly technical
/// jargon when possible.
///
/// ## Data Type
///
/// **string** - A human-readable string value:
///
/// - Can contain spaces, punctuation, and special characters
/// - Should be reasonably concise while remaining descriptive
/// - May include formatting for better readability
/// - Can support multiple languages through internationalization
/// - Should avoid excessive length that impacts display
/// - May include version indicators or qualifiers for clarity
///
/// ## Constraints
///
/// - **Required**: Optional for most resources, recommended for canonical
/// resources
/// - **Cardinality**: 0..1 (at most one occurrence)
/// - **Length**: Should be practical for display purposes (typically under
/// 200 characters)
/// - **Format**: Free-text string without specific format restrictions
/// - **Uniqueness**: Not required to be unique, but should be distinctive
/// within context
/// - **Language**: Should match the language of the resource or be
/// appropriately localized
///
/// ## Examples
///
/// See the accompanying `example.json` file for complete
/// StructureDefinition and ValueSet resources demonstrating the title usage
/// in various clinical contexts.
///
/// ## Related Keys
///
/// - `name` - Machine-readable identifier that complements the
/// human-readable title
/// - `description` - Longer narrative text that provides additional detail
/// beyond the title
/// - `publisher` - Entity responsible for the resource, often reflected in
/// professional titles
/// - `status` - Indicates whether the titled resource is active and
/// available for use
/// - `version` - Business version that may be referenced in title for
/// version-specific resources
/// - `url` - Canonical identifier that the title makes human-readable
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for canonical resource types and string
/// data type definitions.
///
pub title: String,
/// # status
///
/// ## Description
///
/// The `status` attribute indicates the current state of a resource within
/// its workflow or lifecycle. It provides important information about
/// whether the resource is active, completed, cancelled, or in some other
/// defined state according to FHIR R5 specifications.
///
/// ## Purpose
///
/// The `status` element serves to:
///
/// - Indicate the current workflow state of the resource
/// - Support workflow management and business process automation
/// - Enable filtering and querying based on resource state
/// - Prevent inappropriate use of outdated or cancelled information
/// - Support audit trails and state transition tracking
/// - Ensure clinical safety by clearly indicating resource validity
///
/// ## Usage
///
/// Use the `status` attribute to:
///
/// - Track the lifecycle state of clinical and administrative resources
/// - Filter resources based on their current state
/// - Implement workflow rules and business logic
/// - Ensure clinical safety by checking resource status before use
/// - Support reporting and analytics based on resource states
///
/// The specific status values and their meanings vary by resource type, but
/// common patterns include active/inactive, draft/final, and various
/// workflow-specific states.
///
/// ## Data Type
///
/// **code** - A string value from a predefined set of status codes specific
/// to each resource type. Common status patterns include:
///
/// - **Workflow states**: draft, active, inactive, suspended, completed,
/// cancelled
/// - **Publication states**: draft, published, retired
/// - **Request states**: planned, requested, received, accepted,
/// in-progress, completed, suspended, rejected, failed
/// - **Event states**: preparation, in-progress, completed,
/// entered-in-error
///
/// ## Constraints
///
/// - **Required**: Usually required - Most FHIR resources with workflow
/// implications require a status
/// - **Cardinality**: 0..1 or 1..1 (depending on resource type)
/// - **Fixed ValueSet**: Must be from the specific ValueSet defined for
/// each resource type
/// - **Modifies Meaning**: Status often affects the interpretation of the
/// entire resource
/// - **Immutability**: Some status transitions may be irreversible (e.g.,
/// completed to cancelled)
///
/// ## Examples
///
/// See the accompanying `example.json` file for complete resources
/// demonstrating the use of the `status` attribute across different
/// resource types including ServiceRequest, DiagnosticReport, and
/// MedicationRequest.
///
/// ## Related Keys
///
/// - `meta.lastUpdated` - When the status was last changed
/// - Various date/time fields that may be associated with status changes
/// - `extension` - May contain additional status-related information
/// - Resource-specific elements that depend on the current status
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details on status values
/// for specific resource types, refer to the official FHIR R5 documentation
/// and the respective ValueSets defined for each resource's status element.
///
pub status: String,
/// # experimental
///
/// ## Description
///
/// The `experimental` field indicates whether a FHIR resource is intended
/// for testing, experimentation, or preliminary use rather than production
/// deployment. It serves as a warning flag for implementers about the
/// stability and maturity of the resource.
///
/// ## Purpose
///
/// - Indicate developmental or experimental status
/// - Warn implementers about potential instability
/// - Support graduated resource development processes
/// - Enable safe testing and validation environments
/// - Distinguish between production-ready and experimental content
///
/// ## Usage
///
/// The `experimental` field is commonly used in:
/// - **StructureDefinition**: Experimental profiles and extensions
/// - **ValueSet**: Draft or experimental value sets
/// - **CodeSystem**: Experimental code systems
/// - **ImplementationGuide**: Pilot or experimental implementation guides
/// - **CapabilityStatement**: Experimental server capabilities
///
/// ## Data Type
///
/// - **Type**: boolean
/// - **Cardinality**: 0..1
/// - **Values**:
/// - `true`: Resource is experimental
/// - `false`: Resource is not experimental (production-ready)
///
/// ## Constraints
///
/// - Should accurately reflect the resource's development status
/// - Must be consistent with resource lifecycle management
/// - Should be updated as resource matures
/// - Must consider impact on dependent resources
///
/// ## Examples
///
/// See the accompanying `example.json` for practical usage examples.
///
/// ## Related Keys
///
/// - `status`: Resource lifecycle status
/// - `version`: Resource version identifier
/// - `date`: Resource modification date
/// - `publisher`: Organization responsible for resource
/// - `jurisdiction`: Applicable jurisdictions
///
/// ## Specification Reference
///
/// - [FHIR R5 Resource
/// Metadata](https://hl7.org/fhir/R5/resource.html#meta)
/// - [FHIR R5 Conformance
/// Resources](https://hl7.org/fhir/R5/conformance-module.html)
/// - [FHIR R5 Resource Lifecycle](https://hl7.org/fhir/R5/lifecycle.html)
///
pub experimental: bool,
/// # date
///
/// ## Description
///
/// The `date` attribute represents the publication, creation, revision, or
/// last update date of a FHIR resource. This timestamp provides crucial
/// information about when the resource was published or last modified,
/// enabling users to assess the currency and relevance of the content,
/// track version history, and make informed decisions about resource usage.
///
/// ## Purpose
///
/// The `date` exists to provide temporal context for FHIR resources. This
/// enables:
///
/// - Assessment of resource currency and relevance
/// - Version control and change tracking
/// - Implementation of data retention and refresh policies
/// - Support for temporal queries and filtering
/// - Compliance with regulatory requirements for data freshness
/// - Trust assessment based on recency of updates
///
/// ## Usage
///
/// Use the `date` attribute when:
///
/// - Publishing or updating canonical resources like StructureDefinitions,
/// ValueSets
/// - Creating clinical resources that need temporal context
/// - Implementing version control and change management systems
/// - Supporting queries that filter resources by publication or update date
/// - Meeting regulatory requirements for date documentation
/// - Enabling cache invalidation and refresh mechanisms
///
/// The date should represent the actual publication or last significant
/// update of the resource content.
///
/// ## Data Type
///
/// **dateTime** - A date and optionally time following ISO 8601 format:
///
/// - Format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS+TZ
/// - Time zone specification is recommended for precision
/// - Can be partial (year, year-month, or full date)
/// - Should use UTC or explicitly specify time zone offset
/// - Precision should match the granularity needed for the use case
///
/// ## Constraints
///
/// - **Required**: Recommended for canonical resources, optional for others
/// - **Cardinality**: 0..1 (zero to one occurrence)
/// - **Format**: Must follow valid dateTime format per FHIR specification
/// - **Precision**: Should match the appropriate level of granularity
/// - **Consistency**: Should be updated when resource content changes
/// significantly
/// - **Accuracy**: Should reflect actual publication or modification dates
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete CodeSystem
/// resource demonstrating the date attribute in a terminology management
/// context.
///
/// ## Related Keys
///
/// - `lastReviewDate` - Date when content was last reviewed for accuracy
/// - `effectivePeriod` - Period when the resource is intended to be in use
/// - `approvalDate` - Date when content was approved for publication
/// - `meta.lastUpdated` - System-generated timestamp of last technical
/// update
/// - `version` - Business version that may correlate with publication dates
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for dateTime data type and metadata
/// requirements for canonical resources.
///
pub date: Option<String>,
/// # publisher
///
/// ## Description
///
/// The `publisher` attribute identifies the organization, individual, or
/// entity responsible for publishing and maintaining a FHIR resource. This
/// field provides transparency about the source and authority behind the
/// resource, enabling users to understand who has created, endorsed, or
/// taken responsibility for the content and its quality.
///
/// ## Purpose
///
/// The `publisher` exists to establish accountability and authority for
/// FHIR resources. This enables:
///
/// - Clear identification of who is responsible for resource content and
/// maintenance
/// - Trust assessment based on the publisher's reputation and authority
/// - Contact point identification for questions or issues about the
/// resource
/// - Support for governance and quality assurance processes
/// - Attribution for intellectual property and licensing considerations
///
/// ## Usage
///
/// Use the `publisher` attribute when:
///
/// - Publishing canonical resources like StructureDefinitions, ValueSets,
/// or Implementation Guides
/// - Establishing organizational ownership and responsibility for resources
/// - Supporting governance frameworks that require publisher identification
/// - Creating resources that need clear attribution for trust and authority
/// - Implementing resource catalogs that organize content by publisher
///
/// The publisher should be clearly identifiable and ideally contactable for
/// resource-related inquiries.
///
/// ## Data Type
///
/// **string** - A human-readable text string identifying the publisher:
///
/// - Should be the official name of the organization or individual
/// - May include department or division information for clarity
/// - Should be consistent across related resources from the same publisher
/// - Avoid abbreviations that might not be universally understood
/// - Can include descriptive text to clarify the publisher's role
///
/// ## Constraints
///
/// - **Required**: Strongly recommended for canonical resources, optional
/// for others
/// - **Cardinality**: 0..1 (zero to one occurrence)
/// - **Format**: Free text, but should follow consistent naming conventions
/// - **Length**: Should be concise but descriptive enough to identify the
/// publisher
/// - **Consistency**: Should be consistent across resources from the same
/// publisher
/// - **Authority**: Should represent the actual publishing authority, not
/// just implementers
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete ValueSet
/// resource demonstrating the publisher attribute in a clinical terminology
/// context.
///
/// ## Related Keys
///
/// - `contact` - Detailed contact information that complements the
/// publisher identification
/// - `author` - Individual contributors who may be different from the
/// publisher
/// - `editor` - Those responsible for editorial oversight, may work for the
/// publisher
/// - `reviewer` - Those who have reviewed the content on behalf of the
/// publisher
/// - `endorser` - Organizations that have endorsed the publisher's work
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for canonical resource types and metadata
/// requirements.
///
pub publisher: Option<String>,
/// # jurisdiction
///
/// ## Description
///
/// The `jurisdiction` key is used in FHIR R5 conformance and terminology
/// resources to specify the legal or political jurisdictions for which the
/// resource is intended or applies. It helps identify the geographic or
/// organizational scope of applicability.
///
/// ## Purpose
///
/// - Specifies geographic or political scope of resource applicability
/// - Enables jurisdiction-specific filtering and discovery
/// - Supports regulatory and legal compliance requirements
/// - Facilitates international and multi-jurisdictional implementations
/// - Provides context for resource interpretation and usage
///
/// ## Usage
///
/// The `jurisdiction` appears in:
///
/// - **StructureDefinition**: To specify where profiles apply
/// - **ValueSet/CodeSystem**: For terminology jurisdiction scope
/// - **CapabilityStatement**: To indicate server/client jurisdiction
/// - **Implementation guides**: For geographic applicability
///
/// ## Data Type
///
/// **CodeableConcept** - Array of coded jurisdictions containing:
/// - `coding` - Coded jurisdiction (typically using ISO 3166 country codes)
/// - `text` - Human-readable jurisdiction description
///
/// ## Constraints
///
/// - Should use standardized jurisdiction codes when available
/// - ISO 3166 country codes are commonly used
/// - Can specify multiple jurisdictions for multi-national resources
/// - Should be consistent with the resource's intended use scope
///
/// ## Examples
///
/// ### Single Country Jurisdiction
///
/// ```json
/// {
/// "jurisdiction": [
/// {
/// "coding": [
/// {
/// "system": "urn:iso:std:iso:3166",
/// "code": "US",
/// "display": "United States of America"
/// }
/// ]
/// }
/// ]
/// }
/// ```
///
/// ### Multiple Jurisdictions
///
/// ```json
/// {
/// "jurisdiction": [
/// {
/// "coding": [
/// {
/// "system": "urn:iso:std:iso:3166",
/// "code": "US",
/// "display": "United States of America"
/// }
/// ]
/// },
/// {
/// "coding": [
/// {
/// "system": "urn:iso:std:iso:3166",
/// "code": "CA",
/// "display": "Canada"
/// }
/// ]
/// }
/// ]
/// }
/// ```
///
/// ### Regional Jurisdiction
/// ```json
/// {
/// "jurisdiction": [
/// {
/// "coding": [
/// {
/// "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
/// "code": "150",
/// "display": "Europe"
/// }
/// ]
/// }
/// ]
/// }
/// ```
///
/// ## Related Keys
///
/// - `useContext` - Context of use for the resource
/// - `publisher` - Organization publishing the resource
/// - `contact` - Contact information for the resource
/// - `copyright` - Copyright and legal notices
/// - `status` - Publication status of the resource
/// - `date` - Publication date
///
/// ## Specification Reference
///
/// - **FHIR R5 Specification**: Used across multiple conformance resources
/// - **ISO 3166 Codes**: [Country
/// Codes](https://www.iso.org/iso-3166-country-codes.html)
/// - **UN M49 Codes**: [Geographic
/// Regions](https://unstats.un.org/unsd/methodology/m49/)
/// - **Context**: Used in conformance and terminology resources for scope
/// definition
///
pub jurisdiction: Option<Vec<Jurisdiction>>,
/// # contact
///
/// ## Description
///
/// The `contact` attribute provides contact information for individuals or
/// organizations associated with a FHIR resource. This includes names,
/// roles, telecommunications details (phone, email, fax), and other means
/// of communication. In canonical resources like StructureDefinitions and
/// ValueSets, contact information typically identifies maintainers,
/// authors, or support personnel who can provide assistance with the
/// resource. In clinical resources, it may represent care team members,
/// emergency contacts, or administrative contacts.
///
/// ## Purpose
///
/// The `contact` exists to:
///
/// - Provide communication channels for resource maintainers and support
/// personnel
/// - Enable stakeholder identification for canonical resources and
/// implementation guides
/// - Support collaboration and feedback mechanisms for FHIR artifacts
/// - Facilitate clinical communication for patient care coordination
/// - Enable emergency contact information for patients and care scenarios
/// - Provide organizational contact points for administrative and business
/// processes
/// - Support regulatory and compliance communication requirements
///
/// ## Usage
///
/// Use the `contact` attribute when:
///
/// - Publishing canonical resources that require maintainer or author
/// identification
/// - Creating implementation guides with support contact information
/// - Managing patient emergency contacts and care team communication
/// - Establishing organizational contact points for business relationships
/// - Supporting regulatory submissions that require contact information
/// - Enabling collaboration on FHIR artifacts and clinical content
/// - Providing support channels for users of FHIR resources and systems
///
/// Contact information should be current, accurate, and appropriate for the
/// intended use.
///
/// ## Data Type
///
/// **ContactDetail** - A complex structure containing:
///
/// - `name` (string): Name of the contact person or organization
/// - `telecom` (ContactPoint[]): Telecommunications details (phone, email,
/// fax, etc.)
///
/// **ContactPoint elements include:**
///
/// - `system` (code): Communication system
/// (phone|fax|email|pager|url|sms|other)
/// - `value` (string): The actual contact value (phone number, email
/// address, etc.)
/// - `use` (code): Purpose of the contact (home|work|temp|old|mobile)
/// - `rank` (positiveInt): Preference order for multiple contacts
/// - `period` (Period): Time period when contact is valid
///
/// ## Constraints
///
/// - **Required**: Optional for most resources, recommended for canonical
/// resources
/// - **Cardinality**: 0..* (zero or more contacts per resource)
/// - **Telecom Systems**: Must use valid values from ContactPointSystem
/// value set
/// - **Use Codes**: Must use valid values from ContactPointUse value set
/// - **Completeness**: Should include sufficient information for effective
/// communication
/// - **Privacy**: Should respect privacy requirements and data protection
/// regulations
/// - **Currency**: Contact information should be kept current and accurate
///
/// ## Examples
///
/// See the accompanying `example.json` file for complete resources
/// demonstrating contact usage in StructureDefinitions, Organizations, and
/// Patient resources with various contact types and telecommunications
/// details.
///
/// ## Related Keys
///
/// - `name` - Name of the contact person or organization
/// - `telecom` - Telecommunications contact points including phone, email,
/// and other systems
/// - `system` - Type of telecommunications system used for contact
/// - `value` - Actual contact value such as phone number or email address
/// - `use` - Purpose or context of the contact information
/// - `publisher` - Entity responsible for the resource, often related to
/// primary contact
/// - `author` - Resource authors who may also serve as contact points
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for ContactDetail data type and
/// ContactPoint structure definitions.
///
pub contact: Option<::serde_json::Value>,
/// # description
///
/// ## Description
///
/// The `description` attribute provides detailed, comprehensive information
/// about a FHIR resource, element, or concept. It serves as the primary
/// field for conveying extended explanatory text that helps users
/// understand the purpose, usage, constraints, and context of the described
/// item beyond what a simple name or title can convey.
///
/// ## Purpose
///
/// The `description` exists to provide comprehensive documentation and
/// context, enabling:
///
/// - Detailed explanation of resource purpose and functionality
/// - Clear guidance on proper usage and implementation
/// - Documentation of constraints, limitations, and special considerations
/// - Support for user understanding and decision-making
/// - Enhanced searchability and discoverability of resources
///
/// ## Usage
///
/// Use the `description` attribute when:
///
/// - Documenting the purpose and scope of StructureDefinitions and profiles
/// - Explaining the clinical context and usage of value sets and code
/// systems
/// - Providing implementation guidance for operation definitions
/// - Describing the rationale behind business rules and constraints
/// - Offering detailed explanations for complex clinical protocols
/// - Supporting user interfaces with comprehensive help text
///
/// Descriptions should be clear, accurate, and comprehensive while
/// remaining concise enough to be useful.
///
/// ## Data Type
///
/// **markdown** or **string** - Rich text content that may include:
///
/// - **markdown**: Supports basic formatting, links, lists, and structured
/// text
/// - **string**: Plain text for simpler description needs
/// - Multi-line text with proper formatting and structure
/// - References to external documentation or standards
/// - Technical details and implementation notes
///
/// ## Constraints
///
/// - **Required**: Conditional - often required for definitional resources
/// - **Cardinality**: Typically 0..1 (zero to one occurrence)
/// - **Length**: Should be comprehensive but not excessively long
/// - **Format**: Should follow markdown conventions when applicable
/// - **Content**: Should be technically accurate and clinically relevant
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete
/// StructureDefinition demonstrating comprehensive use of the `description`
/// attribute in various contexts.
///
/// ## Related Keys
///
/// - `title` - Brief, formal title that complements the description
/// - `purpose` - Specific statement of why the resource exists
/// - `comment` - Additional notes or implementation guidance
/// - `usage` - Specific usage instructions and guidance
/// - `copyright` - Legal information that may relate to usage
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for markdown usage, definitional resource
/// requirements, and description best practices.
///
pub description: Option<String>,
/// # extension
///
/// ## Description
///
/// The `extension` attribute provides a mechanism for extending FHIR
/// resources with additional data elements that are not part of the base
/// resource definition. Extensions allow for local customizations and the
/// addition of new data elements while maintaining interoperability in FHIR
/// R5.
///
/// ## Purpose
///
/// Extensions exist to:
///
/// - Add data elements not covered by the base FHIR specification
/// - Support local, regional, or national requirements
/// - Enable gradual evolution of FHIR without breaking existing
/// implementations
/// - Maintain semantic interoperability through standardized extension
/// definitions
/// - Allow for experimental or emerging data requirements
/// - Support backwards compatibility when new elements are added to FHIR
///
/// ## Usage
///
/// Use extensions when you need to:
///
/// - Include additional data not supported by standard FHIR elements
/// - Implement local business requirements
/// - Support regulatory or compliance requirements
/// - Add experimental data elements before they become part of core FHIR
/// - Extend resources with organization-specific information
///
/// Extensions should always reference a StructureDefinition that defines
/// their meaning and constraints.
///
/// ## Data Type
///
/// **Extension** - A complex data type containing:
///
/// - `url` (required): canonical URI identifying the extension definition
/// - `value[x]` (optional): the actual extension value using one of the
/// allowed FHIR data types
/// - `extension` (optional): nested extensions for complex extension
/// structures
///
/// Extensions can be simple (single value) or complex (containing nested
/// extensions).
///
/// ## Constraints
///
/// - **Required**: No - Extensions are always optional
/// - **Cardinality**: 0..* (zero to many occurrences)
/// - **URL Required**: Every extension must have a `url` that references
/// its definition
/// - **Value or Nested**: Extensions must have either a value or nested
/// extensions, not both
/// - **Definition**: The URL must reference a valid StructureDefinition of
/// type Extension
/// - **Placement**: Can appear on any element that allows extensions
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete Patient resource
/// demonstrating various types of extensions including simple value
/// extensions and complex nested extensions.
///
/// ## Related Keys
///
/// - `modifierExtension` - Extensions that modify the meaning of the
/// element
/// - `url` - Required sub-element identifying the extension
/// - `value[x]` - The extension's value using FHIR data types
/// - Any FHIR element can contain extensions
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details on extension
/// definitions, complex extensions, and extension registries, refer to the
/// official FHIR R5 documentation on extensibility.
///
pub extension: Option<::serde_json::Value>,
/// # identifier
///
/// ## Description
///
/// The `identifier` key is used throughout FHIR R5 resources to provide a
/// unique identification for resources, elements, or entities. Identifiers
/// are used to maintain consistent references across systems and enable
/// interoperability by providing stable, unique identifiers that persist
/// across systems.
///
/// ## Purpose
///
/// - Provides unique identification for resources and entities
/// - Enables consistent referencing across different systems
/// - Supports resource matching and deduplication
/// - Facilitates interoperability between healthcare systems
/// - Maintains stable identifiers independent of resource IDs
///
/// ## Usage
///
/// The `identifier` appears in:
///
/// - **Most FHIR Resources**: As a primary identification mechanism
/// - **Patient**: Medical record numbers, SSN, insurance IDs
/// - **Practitioner**: License numbers, provider IDs
/// - **Organization**: Tax ID, accreditation numbers
/// - **Observation**: Lab order numbers, specimen IDs
///
/// ## Data Type
///
/// **Identifier** - A complex data type containing:
///
/// - `use` - Purpose of the identifier (usual, official, temp, secondary)
/// - `type` - Coded type of identifier
/// - `system` - Namespace for the identifier value
/// - `value` - The actual identifier value
/// - `period` - Time period when identifier is valid
/// - `assigner` - Organization that assigned the identifier
///
/// ## Constraints
///
/// - System and value combination should be unique within the namespace
/// - System should be a valid URI identifying the namespace
/// - Value must be provided if identifier is present
/// - Type should align with the identifier's purpose
/// - Multiple identifiers can be provided for a single resource
///
/// ## Examples
///
/// ### Basic Patient Medical Record Number
///
/// ```json
/// {
/// "identifier": [
/// {
/// "use": "official",
/// "type": {
/// "coding": [
/// {
/// "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
/// "code": "MR",
/// "display": "Medical Record Number"
/// }
/// ]
/// },
/// "system": "http://hospital.example.org/identifiers/mrn",
/// "value": "12345678"
/// }
/// ]
/// }
/// ```
///
/// ### Multiple Identifier Types
///
/// ```json
/// {
/// "identifier": [
/// {
/// "use": "official",
/// "type": {
/// "coding": [
/// {
/// "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
/// "code": "MR",
/// "display": "Medical Record Number"
/// }
/// ]
/// },
/// "system": "http://hospital.example.org/identifiers/mrn",
/// "value": "MRN123456",
/// "assigner": {
/// "display": "Example Hospital"
/// }
/// },
/// {
/// "use": "secondary",
/// "type": {
/// "coding": [
/// {
/// "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
/// "code": "SS",
/// "display": "Social Security Number"
/// }
/// ]
/// },
/// "system": "http://hl7.org/fhir/sid/us-ssn",
/// "value": "123-45-6789"
/// }
/// ]
/// }
/// ```
///
/// ## Related Keys
///
/// - `id` - Logical resource identifier
/// - `system` - Namespace for identifier values
/// - `value` - The actual identifier string
/// - `type` - Coded type of identifier
/// - `use` - Purpose classification
/// - `assigner` - Organization that issued identifier
/// - `reference` - References using identifiers
///
/// ## Specification Reference
///
/// - **FHIR R5 Specification**: [Identifier Data
/// Type](http://hl7.org/fhir/R5/datatypes.html#Identifier)
/// - **Identifier Types**: [Identifier Type
/// Codes](http://hl7.org/fhir/R5/valueset-identifier-type.html)
/// - **Section**: Used across multiple resource types
/// - **Context**: Primary identification mechanism in FHIR resources
///
pub identifier: Option<Vec<Identifier>>,
/// # sourceScopeCanonical
///
/// ## Description
///
/// The `sourceScopeCanonical` property defines the canonical scope for
/// source mappings in ConceptMap resources. It specifies the canonical URI
/// that constrains which source concepts are considered valid within the
/// mapping context.
///
/// ## Purpose
///
/// - Define canonical scope boundaries for source mappings
/// - Constrain source concept selection to specific value sets or systems
/// - Enable scoped validation of source concepts
/// - Support context-specific mapping rules
/// - Facilitate targeted mapping operations from specific scopes
///
/// ## Usage
///
/// The `sourceScopeCanonical` property is used in ConceptMap resources to
/// specify the canonical URI that defines the valid scope for source
/// concepts in the mapping.
///
/// ## Data Type
///
/// **canonical** - A canonical URI reference to a ValueSet, CodeSystem, or
/// other defining resource
///
/// ## Constraints
///
/// - Must be a valid canonical URI format
/// - Should reference an existing FHIR resource with canonical URL
/// - Should align with the mapping's source system or value set
/// - Must be consistent with business mapping requirements
/// - Should support the intended scope validation
///
/// ## Examples
///
/// ### ValueSet Source Scope
/// ```json
/// {
/// "resourceType": "ConceptMap",
/// "sourceScopeCanonical": "http://hl7.org/fhir/ValueSet/administrative-gender"
/// }
/// ```
///
/// ### CodeSystem Source Scope
/// ```json
/// {
/// "sourceScopeCanonical": "http://snomed.info/sct"
/// }
/// ```
///
/// ## Related Keys
///
/// - `targetScopeCanonical` - Target scope canonical references
/// - `sourceScopeUri` - Source scope URI references
/// - `source` - Source concept systems
/// - `sourceCanonical` - Source canonical references
/// - `scope` - General scope definitions
///
/// ## Specification Reference
///
/// FHIR R5 ConceptMap:
/// [sourceScope](http://hl7.org/fhir/R5/conceptmap-definitions.html#ConceptMap.sourceScope_x_)
///
pub source_scope_canonical: Option<String>,
/// # sourceScopeUri
///
/// ## Description
///
/// The `sourceScopeUri` property defines the URI scope for source mappings
/// in ConceptMap resources. It specifies a URI that constrains which source
/// concepts are considered valid within the mapping context.
///
/// ## Purpose
///
/// - Define URI-based scope boundaries for source mappings
/// - Constrain source concept selection to specific URI-identified systems
/// - Enable scoped validation using URI references
/// - Support external system scope definitions
/// - Facilitate targeted mapping operations with URI constraints
///
/// ## Usage
///
/// The `sourceScopeUri` property is used in ConceptMap resources to specify
/// a URI that defines the valid scope for source concepts in the mapping.
///
/// ## Data Type
///
/// **uri** - A URI reference identifying the scope
///
/// ## Constraints
///
/// - Must be a valid URI format
/// - Should be resolvable or recognizable as a scope identifier
/// - Should align with the mapping's source system requirements
/// - Must be consistent with business mapping requirements
/// - Should support the intended scope validation
///
/// ## Examples
///
/// ### External System URI Scope
///
/// ```json
/// {
/// "sourceScopeUri": "http://example.org/terminology/legacy-codes"
/// }
/// ```
///
/// ### Namespace URI Scope
///
/// ```json
/// {
/// "sourceScopeUri": "urn:example:source-scope:legacy-system-2023"
/// }
/// ```
///
/// ## Related Keys
///
/// - `sourceScopeCanonical` - Source scope canonical references
/// - `targetScopeUri` - Target scope URI references
/// - `sourceUri` - Source URI references
/// - `uri` - General URI fields
/// - `scope` - General scope definitions
///
/// ## Specification Reference
///
/// FHIR R5 ConceptMap:
/// [sourceScope](http://hl7.org/fhir/R5/conceptmap-definitions.html#ConceptMap.sourceScope_x_)
///
pub source_scope_uri: Option<String>,
/// # targetScopeCanonical
///
/// ## Description
///
/// The `targetScopeCanonical` property defines the canonical scope for
/// target mappings in ConceptMap resources. It specifies the canonical URI
/// that constrains which target concepts are considered valid within the
/// mapping context.
///
/// ## Purpose
///
/// - Define canonical scope boundaries for target mappings
/// - Constrain target concept selection to specific value sets or systems
/// - Enable scoped validation of target concepts
/// - Support context-specific mapping rules
/// - Facilitate targeted mapping operations
///
/// ## Usage
///
/// The `targetScopeCanonical` property is used in ConceptMap resources to
/// specify the canonical URI that defines the valid scope for target
/// concepts in the mapping.
///
/// ## Data Type
///
/// **canonical** - A canonical URI reference to a ValueSet, CodeSystem, or
/// other defining resource
///
/// ## Constraints
///
/// - Must be a valid canonical URI format
/// - Should reference an existing FHIR resource with canonical URL
/// - Should align with the mapping's target system or value set
/// - Must be consistent with business mapping requirements
/// - Should support the intended scope validation
///
/// ## Examples
///
/// ### ValueSet Target Scope
///
/// ```json
/// {
/// "resourceType": "ConceptMap",
/// "targetScopeCanonical": "http://example.org/fhir/ValueSet/valid-target-codes"
/// }
/// ```
///
/// ### CodeSystem Target Scope
///
/// ```json
/// {
/// "targetScopeCanonical": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"
/// }
/// ```
///
/// ## Related Keys
///
/// - `sourceScopeCanonical` - Source scope canonical references
/// - `targetScopeUri` - Target scope URI references
/// - `target` - Target concept systems
/// - `targetCanonical` - Target canonical references
/// - `scope` - General scope definitions
///
/// ## Specification Reference
///
/// FHIR R5 ConceptMap:
/// [targetScope](http://hl7.org/fhir/R5/conceptmap-definitions.html#ConceptMap.targetScope_x_)
///
pub target_scope_canonical: Option<String>,
/// # targetScopeUri
///
/// ## Description
///
/// The `targetScopeUri` property defines the URI scope for target mappings
/// in ConceptMap resources. It specifies a URI that constrains which target
/// concepts are considered valid within the mapping context.
///
/// ## Purpose
///
/// - Define URI-based scope boundaries for target mappings
/// - Constrain target concept selection to specific URI-identified systems
/// - Enable scoped validation using URI references
/// - Support external system scope definitions
/// - Facilitate targeted mapping operations with URI constraints
///
/// ## Usage
///
/// The `targetScopeUri` property is used in ConceptMap resources to specify
/// a URI that defines the valid scope for target concepts in the mapping.
///
/// ## Data Type
///
/// **uri** - A URI reference identifying the scope
///
/// ## Constraints
///
/// - Must be a valid URI format
/// - Should be resolvable or recognizable as a scope identifier
/// - Should align with the mapping's target system requirements
/// - Must be consistent with business mapping requirements
/// - Should support the intended scope validation
///
/// ## Examples
///
/// ### External System URI Scope
///
/// ```json
/// {
/// "targetScopeUri": "http://example.org/terminology/approved-codes"
/// }
/// ```
///
/// ### Namespace URI Scope
///
/// ```json
/// {
/// "targetScopeUri": "urn:example:target-scope:formulary-2024"
/// }
/// ```
///
/// ## Related Keys
///
/// - `targetScopeCanonical` - Target scope canonical references
/// - `sourceScopeUri` - Source scope URI references
/// - `targetUri` - Target URI references
/// - `uri` - General URI fields
/// - `scope` - General scope definitions
///
/// ## Specification Reference
///
/// FHIR R5 ConceptMap:
/// [targetScope](http://hl7.org/fhir/R5/conceptmap-definitions.html#ConceptMap.targetScope_x_)
///
pub target_scope_uri: Option<String>,
/// # group
///
/// ## Description
///
/// The `group` key is used in FHIR R5 ValueSet resources within the
/// expansion component to organize expansion entries into logical groups.
/// It provides a hierarchical structure for presenting value set expansion
/// results in a more organized and meaningful way.
///
/// ## Purpose
///
/// - Organizes value set expansion entries into logical groupings
/// - Provides hierarchical structure for complex expansions
/// - Enables better user interface presentation of value sets
/// - Supports categorization of codes within expansions
/// - Facilitates navigation of large value set expansions
///
/// ## Usage
///
/// The `group` appears in:
///
/// - **ValueSet**: Within `expansion` component
/// - **Terminology Services**: For structured expansion results
/// - **Code organization**: To group related concepts
/// - **UI presentation**: For organized display of value set contents
///
/// ## Data Type
///
/// **BackboneElement** - A complex structure containing:
/// - `identifier` - Unique identifier for the group
/// - `display` - Human-readable group name
/// - `contains` - Array of expansion entries in this group
/// - `inactive` - Whether the group is inactive
/// - `property` - Additional properties for the group
///
/// ## Constraints
///
/// - Groups can be nested to create hierarchical structures
/// - Must contain at least one expansion entry or sub-group
/// - Group identifiers should be unique within the expansion
/// - Display names should be meaningful for human readers
/// - Can contain both individual codes and other groups
///
/// ## Examples
///
/// ### Basic Value Set Group
/// ```json
/// {
/// "group": [
/// {
/// "identifier": "medications",
/// "display": "Medications",
/// "contains": [
/// {
/// "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
/// "code": "1049502",
/// "display": "Acetaminophen 325 MG Oral Tablet"
/// }
/// ]
/// }
/// ]
/// }
/// ```
///
/// ### Nested Group Structure
///
/// ```json
/// {
/// "group": [
/// {
/// "identifier": "cardiovascular",
/// "display": "Cardiovascular Medications",
/// "group": [
/// {
/// "identifier": "beta-blockers",
/// "display": "Beta Blockers",
/// "contains": [
/// {
/// "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
/// "code": "866511",
/// "display": "Metoprolol"
/// }
/// ]
/// }
/// ]
/// }
/// ]
/// }
/// ```
///
/// ## Related Keys
/// - `expansion` - Parent container for value set expansion
/// - `contains` - Individual entries within groups
/// - `identifier` - Unique identifiers for groups
/// - `display` - Human-readable group labels
/// - `property` - Additional group metadata
/// - `inactive` - Group status indicator
///
/// ## Specification Reference
/// - **FHIR R5 Specification**: [ValueSet -
/// Expansion](http://hl7.org/fhir/R5/valueset.html#expansion)
/// - **Expansion Groups**:
/// [ValueSet.expansion.group](http://hl7.org/fhir/R5/valueset-definitions.html#ValueSet.expansion.group)
/// - **Section**: ValueSet.expansion.group
/// - **Context**: Used in terminology services and value set expansions
///
pub group: ::serde_json::Value, //TODO is this the same kind of `group` as expected?
/// # copyright
///
/// ## Description
///
/// The `copyright` field contains copyright and intellectual property
/// rights information for FHIR resources such as ImplementationGuide,
/// ValueSet, CodeSystem, and other definitional resources. It provides
/// legal notice about the ownership and usage rights of the resource.
///
/// ## Purpose
///
/// - Specify copyright ownership and intellectual property rights
/// - Provide legal notice for resource usage
/// - Indicate licensing terms and restrictions
/// - Support compliance with intellectual property requirements
/// - Enable proper attribution of resource authorship
///
/// ## Usage
///
/// The `copyright` field is commonly used in:
///
/// - **ImplementationGuide**: Copyright information for the entire guide
/// - **ValueSet**: Copyright for value set definitions and content
/// - **CodeSystem**: Copyright for code system definitions
/// - **StructureDefinition**: Copyright for profile definitions
/// - **Other definitional resources**: Any resource requiring copyright
/// notice
///
/// ## Data Type
///
/// - **Type**: markdown
/// - **Cardinality**: 0..1
/// - **Format**: Markdown-formatted text allowing rich formatting
///
/// ## Constraints
///
/// - Should include clear copyright ownership statement
/// - Must comply with applicable copyright laws
/// - Should specify usage permissions and restrictions
/// - May reference external license terms
///
/// ## Examples
///
/// See the accompanying `example.json` for practical usage examples.
///
/// ## Related Keys
///
/// - `copyrightLabel`: Short copyright label for display
/// - `publisher`: Entity responsible for publication
/// - `contact`: Contact information for rights holder
/// - `useContext`: Context where copyright applies
/// - `jurisdiction`: Legal jurisdiction for copyright
///
/// ## Specification Reference
///
/// - [FHIR R5
/// ImplementationGuide](https://hl7.org/fhir/R5/implementationguide.html)
/// - [FHIR R5 ValueSet](https://hl7.org/fhir/R5/valueset.html)
/// - [FHIR R5 CodeSystem](https://hl7.org/fhir/R5/codesystem.html)
///
pub copyright: Option<String>,
/// # purpose
///
/// ## Description
///
/// The `purpose` attribute provides an explanation of why a FHIR resource
/// exists and what it is intended to accomplish. This element goes beyond
/// the technical description to articulate the clinical, business, or
/// regulatory rationale for the resource's creation and use. The purpose
/// helps implementers understand the intended context and appropriate
/// applications for the resource, supporting better decision-making about
/// adoption and implementation.
///
/// ## Purpose
///
/// The `purpose` exists to:
///
/// - Explain the rationale and intended use cases for FHIR resources
/// - Provide context for implementers to understand appropriate
/// applications
/// - Support decision-making about resource adoption and implementation
/// - Document regulatory or business requirements that drove resource
/// creation
/// - Enable better resource discovery and selection for specific use cases
/// - Facilitate understanding of resource scope and boundaries
/// - Support governance and compliance requirements for resource usage
///
/// ## Usage
///
/// Use the `purpose` attribute when:
///
/// - Publishing canonical resources like StructureDefinitions, ValueSets,
/// or CodeSystems
/// - Creating implementation guides that need clear use case documentation
/// - Supporting regulatory submissions that require rationale documentation
/// - Enabling resource discovery and selection processes
/// - Providing guidance for implementers about appropriate resource usage
/// - Documenting business or clinical requirements that justify resource
/// creation
/// - Supporting governance processes that require purpose documentation
///
/// The purpose should be clear, concise, and focused on the "why" rather
/// than the "what" or "how".
///
/// ## Data Type
///
/// **markdown** - Formatted text supporting Markdown syntax:
///
/// - Supports rich text formatting including lists, emphasis, and links
/// - Should be concise but comprehensive enough to explain the rationale
/// - May include references to regulatory requirements or clinical
/// guidelines
/// - Can use formatting to improve readability and organization
/// - Should avoid overly technical jargon when possible
/// - May include examples or scenarios to illustrate intended use
///
/// ## Constraints
///
/// - **Required**: Optional but strongly recommended for canonical
/// resources
/// - **Cardinality**: 0..1 (at most one purpose statement per resource)
/// - **Length**: Should be substantial enough to explain rationale but
/// concise for readability
/// - **Format**: Markdown text that renders appropriately in documentation
/// systems
/// - **Language**: Should match the language specified in the resource
/// - **Clarity**: Should be understandable to the target audience of
/// implementers
/// - **Accuracy**: Should accurately reflect the actual intended use and
/// rationale
///
/// ## Examples
///
/// See the accompanying `example.json` file for complete resources
/// demonstrating purpose usage in various FHIR resources including
/// StructureDefinitions, ValueSets, and ImplementationGuides with clear
/// rationale statements.
///
/// ## Related Keys
///
/// - `description` - Technical description that complements the purpose
/// with "what" information
/// - `title` - Human-readable name that should align with the stated
/// purpose
/// - `useContext` - Specific contexts where the resource applies,
/// supporting the purpose
/// - `jurisdiction` - Geographic or organizational scope related to the
/// purpose
/// - `copyright` - Legal context that may relate to the purpose and
/// intended use
/// - `publisher` - Organization responsible for the resource, often related
/// to the purpose
/// - `status` - Current status that indicates readiness for the stated
/// purpose
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for canonical resource types and purpose
/// element usage guidelines.
///
pub purpose: Option<String>,
/// # topic
///
/// ## Description
///
/// The `topic` property identifies the clinical or administrative topics
/// covered by a FHIR resource, enabling categorization and discovery.
///
/// ## Purpose
///
/// - Categorize resources by clinical topics
/// - Enable topic-based search and filtering
/// - Support knowledge organization
/// - Facilitate content discovery
/// - Enable topic-specific workflows
///
/// ## Usage
///
/// The `topic` property is used in knowledge resources like PlanDefinition,
/// ActivityDefinition, and others to identify covered topics.
///
/// ## Data Type
///
/// **CodeableConcept** - Coded topic classifications
///
/// ## Constraints
///
/// - Should use recognized topic vocabularies
/// - Must accurately represent resource content
/// - Should support discovery and categorization
/// - Can include multiple topics
///
/// ## Examples
///
/// ### Clinical Topic
/// ```json
/// {
/// "topic": [{
/// "coding": [{
/// "system": "http://snomed.info/sct",
/// "code": "73211009",
/// "display": "Diabetes mellitus"
/// }]
/// }]
/// }
/// ```
///
/// ## Related Keys
///
/// - `category` - General categories
/// - `type` - Resource types
/// - `subject` - Subject references
/// - `useContext` - Usage contexts
///
/// ## Specification Reference
///
/// FHIR R5 Metadata:
/// [topic](http://hl7.org/fhir/R5/metadatatypes.html#UsageContext)
///
pub topic: Option<Vec<Topic>>,
/// # relatedArtifact
///
/// ## Description
///
/// The `relatedArtifact` property references external documents,
/// publications, websites, or other artifacts that are related to or
/// support the current resource. It provides citations, links, and metadata
/// about related materials.
///
/// ## Purpose
///
/// - Reference supporting literature and evidence
/// - Link to related guidelines, protocols, or standards
/// - Provide citations for clinical evidence
/// - Connect to external documentation and resources
/// - Support evidence-based practice and research
///
/// ## Usage
///
/// The `relatedArtifact` property is used across many FHIR resources to
/// reference external artifacts like publications, guidelines, or
/// supporting documentation that relate to the resource content.
///
/// ## Data Type
///
/// **RelatedArtifact** - A complex data type containing:
/// - `type` - Type of relationship (documentation, citation, etc.)
/// - `label` - Short label for the artifact
/// - `display` - Brief description
/// - `citation` - Bibliographic citation
/// - `url` - Link to the artifact
/// - `document` - Attached document
/// - `resource` - Reference to a FHIR resource
/// - `resourceReference` - Reference to a related resource
///
/// ## Constraints
///
/// - Must specify the type of relationship
/// - Should provide sufficient information to locate the artifact
/// - Either citation, url, document, or resource should be provided
/// - Citations should follow standard bibliographic formats
///
/// ## Examples
///
/// ### Citation to Published Study
/// ```json
/// {
/// "relatedArtifact": [
/// {
/// "type": "citation",
/// "label": "Primary Evidence",
/// "display": "Randomized controlled trial on medication effectiveness",
/// "citation": "Smith J, et al. Efficacy of Treatment X in Hypertension: A Randomized Controlled Trial. New England Journal of Medicine. 2024;380(1):23-31.",
/// "url": "https://doi.org/10.1056/NEJMoa2024001"
/// }
/// ]
/// }
/// ```
///
/// ### Link to Clinical Guideline
/// ```json
/// {
/// "relatedArtifact": [
/// {
/// "type": "documentation",
/// "label": "Clinical Guideline",
/// "display": "AHA/ACC Hypertension Guidelines 2024",
/// "url": "https://www.ahajournals.org/hypertension-guidelines"
/// }
/// ]
/// }
/// ```
///
/// ## Related Keys
///
/// - `library` - References to logic libraries
/// - `extension` - Additional resource extensions
/// - `contained` - Contained resources
/// - `text` - Human-readable narrative
///
/// ## Specification Reference
///
/// FHIR R5 Data Types:
/// [RelatedArtifact](http://hl7.org/fhir/R5/metadatatypes.html#RelatedArtifact)
///
pub related_artifact: Option<Vec<RelatedArtifact>>,
/// # property
///
/// ## Description
///
/// The `property` attribute defines additional properties and metadata
/// associated with concepts in a CodeSystem. It provides structured
/// information about concepts beyond the basic code, display, and
/// definition, enabling rich semantic descriptions and supporting complex
/// terminology operations. Properties can represent various aspects of
/// concepts including relationships, classifications, and computational
/// attributes.
///
/// ## Purpose
///
/// The `property` exists to provide extensible concept metadata that
/// enables:
///
/// - Rich semantic descriptions of terminology concepts
/// - Support for complex terminology relationships and hierarchies
/// - Computational attributes for terminology operations
/// - Classification and categorization information
/// - Version and lifecycle management of concepts
/// - Integration with external terminology systems and standards
///
/// ## Usage
///
/// Use the `property` attribute when:
///
/// - Defining concept metadata beyond basic identification
/// - Implementing hierarchical relationships between concepts
/// - Supporting advanced terminology operations and filtering
/// - Providing classification and categorization information
/// - Enabling computational processing of concepts
/// - Supporting concept lifecycle and version management
///
/// Properties are defined at the CodeSystem level and assigned values at
/// the concept level.
///
/// ## Data Type
///
/// **BackboneElement** - Property definition (at CodeSystem level):
///
/// - `code` (code) - Identifies the property
/// - `uri` (uri) - Formal identifier for the property
/// - `description` (string) - Description of the property
/// - `type` (code) - Data type (code, Coding, string, integer, boolean,
/// dateTime, decimal)
///
/// **BackboneElement** - Property value (at concept level):
///
/// - `code` (code) - Identifies which property
/// - `value[x]` - The property value (type determined by property
/// definition)
///
/// ## Constraints
///
/// - **Required**: Code is required for both property definitions and
/// values
/// - **Cardinality**: 0..* (zero to many occurrences)
/// - **Type Consistency**: Property values must match the defined type
/// - **Code Uniqueness**: Property codes should be unique within a
/// CodeSystem
/// - **URI Uniqueness**: Property URIs should be globally unique when
/// present
/// - **Value Validation**: Property values should conform to their defined
/// constraints
///
/// ## Examples
///
/// See the accompanying `example.json` file for a complete CodeSystem
/// resource demonstrating the `property` attribute with various property
/// types, relationships, and concept-level property values.
///
/// ## Related Keys
///
/// - `code` - Identifier for the property or concept
/// - `uri` - Formal URI identifier for the property
/// - `type` - Data type of property values
/// - `value[x]` - Property value with type-specific suffix
/// - `concept` - Parent concept containing property values
/// - `description` - Human-readable property description
/// - `filter` - Related element that can reference properties
///
/// ## Specification Reference
///
/// Based on FHIR R5 specification. For complete details, refer to the
/// official FHIR R5 documentation for CodeSystem resource and concept
/// property definitions.
///
pub property: Option<Vec<Property>>,
/// # approvalDate
///
/// ## Description
///
/// The `approvalDate` property represents the date when a resource was
/// officially approved by the appropriate authority or governance body.
/// This date marks formal endorsement and authorization for use within the
/// intended context.
///
/// ## Purpose
///
/// - Track formal approval milestones in resource lifecycle
/// - Support governance and compliance requirements
/// - Provide audit trail for regulatory submissions
/// - Enable quality assurance and validation workflows
/// - Support version control and release management processes
///
/// ## Usage
///
/// The `approvalDate` property is used in various FHIR metadata resources
/// such as ImplementationGuide, ValueSet, CodeSystem, StructureDefinition,
/// and other knowledge artifacts that require formal approval processes
/// before publication or deployment.
///
/// ## Data Type
///
/// **date** - ISO 8601 date format (YYYY-MM-DD)
///
/// ## Constraints
///
/// - Must be a valid date in ISO 8601 format
/// - Should not be a future date (approval cannot be in the future)
/// - Should be on or after the creation/authoring date if specified
/// - May be the same as or different from publication date
/// - Optional - not all resources require formal approval processes
///
/// ## Examples
///
/// ### Implementation Guide with Approval Date
/// ```json
/// {
/// "approvalDate": "2023-11-15",
/// "date": "2023-12-01",
/// "status": "active"
/// }
/// ```
///
/// ### ValueSet Approval Process
/// ```json
/// {
/// "approvalDate": "2023-10-01",
/// "lastReviewDate": "2023-09-15",
/// "effectivePeriod": {
/// "start": "2023-11-01"
/// }
/// }
/// ```
///
/// ### Clinical Guideline Approval
/// ```json
/// {
/// "approvalDate": "2023-08-30",
/// "date": "2023-09-01",
/// "publisher": "Clinical Guidelines Committee"
/// }
/// ```
///
/// ## Related Keys
///
/// - `date` - Publication or release date of the resource
/// - `lastReviewDate` - Most recent review date
/// - `effectivePeriod` - Period when the resource is effective
/// - `publisher` - Organization responsible for publishing
/// - `status` - Current status of the resource
///
/// ## Specification Reference
///
/// FHIR R5: [Common Metadata Elements - Approval
/// Date](http://hl7.org/fhir/R5/metadatatypes.html#PublicationMetadata.approvalDate)
///
pub approval_date: Option<String>,
/// # lastReviewDate
///
/// ## Description
///
/// The `lastReviewDate` property specifies the date when the resource was
/// last reviewed for accuracy, currency, and completeness. This indicates
/// when the content was last validated by appropriate subject matter
/// experts.
///
/// ## Purpose
///
/// - Track when content was last reviewed for accuracy and currency
/// - Support governance and quality assurance processes
/// - Indicate the currency of the information for users
/// - Enable lifecycle management and review scheduling
///
/// ## Usage
///
/// The `lastReviewDate` property is used in knowledge artifacts and
/// conformance resources to track when the content was last formally
/// reviewed. This is different from the last modification date, as it
/// represents a formal review process rather than simple content changes.
///
/// ## Data Type
///
/// **date** - ISO 8601 date format (YYYY-MM-DD)
///
/// ## Constraints
///
/// - Must be a valid date in ISO 8601 format
/// - Should not be in the future
/// - Should be on or after the original publication date
/// - May be the same as or different from the publication date
///
/// ## Examples
///
/// ### CodeSystem with Review Date
///
/// ```json
/// {
/// "resourceType": "CodeSystem",
/// "url": "http://example.org/fhir/CodeSystem/example",
/// "version": "1.2.0",
/// "name": "ExampleCodeSystem",
/// "status": "active",
/// "date": "2023-01-15",
/// "lastReviewDate": "2024-08-20",
/// "publisher": "Example Organization"
/// }
/// ```
///
/// ### ValueSet with Review Information
///
/// ```json
/// {
/// "resourceType": "ValueSet",
/// "url": "http://example.org/fhir/ValueSet/medication-codes",
/// "version": "2.1.0",
/// "name": "MedicationCodes",
/// "status": "active",
/// "date": "2023-06-01",
/// "lastReviewDate": "2024-06-01",
/// "effectivePeriod": {
/// "start": "2023-06-01"
/// }
/// }
/// ```
///
/// ## Related Keys
///
/// - `date` - The publication or last change date
/// - `effectivePeriod` - The period during which the resource is effective
/// - `approvalDate` - Date of formal approval
/// - `version` - Version identifier that may change with reviews
///
/// ## Specification Reference
///
/// FHIR R5 MetadataResource:
/// [MetadataResource.lastReviewDate](http://hl7.org/fhir/R5/metadataresource.html#MetadataResource.lastReviewDate)
///
pub last_review_date: Option<String>,
/// # author
///
/// ## Description
///
/// The `author` property identifies the individual, organization, or system responsible for creating, authoring, or originating a resource. It provides attribution and accountability for the content or data within the resource.
///
/// ## Purpose
///
/// - Establish accountability and responsibility for resource content
/// - Support attribution requirements for clinical and research data
/// - Enable contact and communication with content creators
/// - Provide audit trail for resource authorship
/// - Support workflow and approval processes
///
/// ## Usage
///
/// The `author` property appears in various FHIR resources including clinical documents, knowledge artifacts, and data collection resources. It typically references a Practitioner, Organization, Device, or Patient who created or is responsible for the content.
///
/// ## Data Type
///
/// **Reference** to Practitioner | PractitionerRole | Organization | Device | Patient | RelatedPerson
///
/// May also appear as **ContactDetail** in metadata resources
///
/// ## Constraints
///
/// - Must reference a valid FHIR resource of the appropriate type
/// - Should be resolvable if provided as a Reference
/// - Multiple authors are typically supported through arrays
/// - Should represent the actual author, not just a data entry person
///
/// ## Examples
///
/// ### Clinical Document Author
/// ```json
/// {
/// "author": [
/// {
/// "reference": "Practitioner/dr-johnson",
/// "display": "Dr. Sarah Johnson, MD"
/// }
/// ]
/// }
/// ```
///
/// ### Knowledge Resource with Multiple Authors
/// ```json
/// {
/// "author": [
/// {
/// "name": "Clinical Guidelines Committee",
/// "telecom": [
/// {
/// "system": "email",
/// "value": "guidelines@hospital.org"
/// }
/// ]
/// },
/// {
/// "name": "Dr. Michael Smith",
/// "telecom": [
/// {
/// "system": "email",
/// "value": "msmith@hospital.org"
/// }
/// ]
/// }
/// ]
/// }
/// ```
///
/// ## Related Keys
///
/// - `subject` - The focus or subject of the resource
/// - `performer` - Who performed an action or procedure
/// - `contact` - Contact information for the resource
/// - `publisher` - Organization responsible for publishing
/// - `editor` - Those who edited or reviewed the content
///
/// ## Specification Reference
///
/// FHIR R5: [Resource Attribution](http://hl7.org/fhir/R5/) (varies by specific resource type)
///
pub author: Option<Vec<Contact>>,
/// # reviewer
///
/// ## Description
///
/// The `reviewer` property identifies individuals or organizations that
/// have reviewed a FHIR resource for accuracy, completeness, and
/// appropriateness.
///
/// ## Purpose
///
/// - Document review process and accountability
/// - Identify subject matter experts who validated content
/// - Support quality assurance workflows
/// - Enable reviewer contact for questions or updates
/// - Facilitate governance and approval tracking
///
/// ## Usage
///
/// The `reviewer` property is used in resources like ImplementationGuide,
/// ActivityDefinition, and other knowledge resources to document review
/// participation.
///
/// ## Data Type
///
/// **ContactDetail** - Contact information for reviewers
///
/// ## Constraints
///
/// - Should provide meaningful contact information
/// - Must identify actual reviewers
/// - Should support follow-up communication
/// - Can include multiple reviewers
///
/// ## Examples
///
/// ### Implementation Guide Reviewer
///
/// ```json
/// {
/// "reviewer": [
/// {
/// "name": "Dr. Jane Smith",
/// "telecom": [
/// {
/// "system": "email",
/// "value": "jane.smith@example.org"
/// }
/// ]
/// }
/// ]
/// }
/// ```
///
/// ## Related Keys
///
/// - `author` - Resource authors
/// - `editor` - Resource editors
/// - `endorser` - Resource endorsers
/// - `contact` - General contacts
///
/// ## Specification Reference
///
/// FHIR R5 Metadata:
/// [reviewer](http://hl7.org/fhir/R5/metadatatypes.html#ContactDetail)
///
pub reviewer: Option<Vec<Contact>>,
/// # editor
///
/// ## Description
///
/// The `editor` field identifies individuals or organizations who have
/// contributed to the editing and review of a FHIR resource, particularly
/// definitional resources like implementation guides, value sets, and
/// profiles. It acknowledges editorial contributions distinct from primary
/// authorship.
///
/// ## Purpose
///
/// - Acknowledge editorial contributions to FHIR resources
/// - Provide contact information for content editors
/// - Support resource governance and maintenance
/// - Enable collaboration and review processes
/// - Document editorial oversight and review
///
/// ## Usage
///
/// The `editor` field is commonly used in:
///
/// - **ImplementationGuide**: Editorial contributors to the guide
/// - **ValueSet**: Editors who reviewed and refined value sets
/// - **CodeSystem**: Editorial oversight for code system development
/// - **StructureDefinition**: Profile editors and reviewers
/// - **Library**: Clinical logic editors and validators
///
/// ## Data Type
///
/// - **Type**: ContactDetail
/// - **Cardinality**: 0..*
/// - **Components**:
/// - `name`: Name of the editor
/// - `telecom`: Contact information for the editor
///
/// ## Constraints
///
/// - Should represent actual editorial contributors
/// - Contact information should be current and valid
/// - Must distinguish from primary authors
/// - Should reflect actual editorial role and contribution
///
/// ## Examples
///
/// See the accompanying `example.json` for practical usage examples.
///
/// ## Related Keys
///
/// - `author`: Primary authors of the resource
/// - `reviewer`: Reviewers of the resource
/// - `endorser`: Organizations that endorse the resource
/// - `contact`: General contact information
/// - `contributor`: Other types of contributors
///
/// ## Specification Reference
/// - [FHIR R5
/// ImplementationGuide](https://hl7.org/fhir/R5/implementationguide.html)
/// - [FHIR R5
/// ContactDetail](https://hl7.org/fhir/R5/metadatatypes.html#ContactDetail)
/// - [FHIR R5 Metadata
/// Resources](https://hl7.org/fhir/R5/conformance-module.html)
///
pub editor: Option<Vec<Contact>>,
/// # endorser
///
/// ## Description
///
/// The `endorser` field identifies organizations or individuals who
/// formally endorse or approve a FHIR resource, particularly definitional
/// resources like implementation guides, value sets, and clinical
/// guidelines. It represents official organizational support or approval.
///
/// ## Purpose
///
/// - Document official endorsements and approvals
/// - Provide credibility and authority to resources
/// - Support governance and quality assurance processes
/// - Enable stakeholder identification and accountability
/// - Facilitate adoption and implementation decisions
///
/// ## Usage
///
/// The `endorser` field is commonly used in:
///
/// - **ImplementationGuide**: Organizations endorsing the implementation
/// guide
/// - **ValueSet**: Professional societies endorsing value sets
/// - **CodeSystem**: Standards bodies endorsing code systems
/// - **Measure**: Quality organizations endorsing quality measures
/// - **Library**: Clinical societies endorsing decision support logic
///
/// ## Data Type
///
/// - **Type**: ContactDetail
/// - **Cardinality**: 0..*
/// - **Components**:
/// - `name`: Name of the endorsing organization or individual
/// - `telecom`: Contact information for the endorser
///
/// ## Constraints
///
/// - Should represent actual formal endorsements
/// - Contact information should be current and authoritative
/// - Must distinguish from authors, editors, and reviewers
/// - Should reflect official organizational approval
///
/// ## Examples
///
/// See the accompanying `example.json` for practical usage examples.
///
/// ## Related Keys
///
/// - `author`: Primary authors of the resource
/// - `editor`: Editorial contributors
/// - `reviewer`: Review contributors
/// - `publisher`: Publishing organization
/// - `contact`: General contact information
///
/// ## Specification Reference
///
/// - [FHIR R5
/// ImplementationGuide](https://hl7.org/fhir/R5/implementationguide.html)
/// - [FHIR R5
/// ContactDetail](https://hl7.org/fhir/R5/metadatatypes.html#ContactDetail)
/// - [FHIR R5 Metadata
/// Resources](https://hl7.org/fhir/R5/conformance-module.html)
///
pub endorser: Option<Vec<Contact>>,
/// # effectivePeriod
///
/// ## Description
///
/// The `effectivePeriod` field specifies the time period during which a
/// resource, rule, or definition is considered active and valid. It defines
/// when the resource should be used or applied, supporting temporal aspects
/// of healthcare data and clinical decision-making.
///
/// ## Purpose
///
/// - Define validity timeframes for resources and definitions
/// - Support temporal clinical decision-making
/// - Enable time-based resource activation and deactivation
/// - Manage resource lifecycle and versioning
/// - Support historical and future-dated content
///
/// ## Usage
///
/// The `effectivePeriod` field is commonly used in:
///
/// - **ActivityDefinition**: When clinical activities should be performed
/// - **PlanDefinition**: Validity period for care plans
/// - **Measure**: Reporting periods for quality measures
/// - **Library**: Active period for clinical logic
/// - **EvidenceVariable**: Temporal scope of evidence
///
/// ## Data Type
///
/// - **Type**: Period
/// - **Cardinality**: 0..1
/// - **Components**:
/// - `start`: Beginning of the effective period
/// - `end`: End of the effective period
///
/// ## Constraints
///
/// - Start date should be before or equal to end date
/// - Periods should align with clinical or business requirements
/// - Must consider timezone implications for global use
/// - Should not conflict with resource status
///
/// ## Examples
///
/// See the accompanying `example.json` for practical usage examples.
///
/// ## Related Keys
///
/// - `date`: Resource creation or modification date
/// - `period`: General time periods in resources
/// - `status`: Resource lifecycle status
/// - `experimental`: Development status indicator
/// - `version`: Resource version identifier
///
/// ## Specification Reference
///
/// - [FHIR R5
/// ActivityDefinition](https://hl7.org/fhir/R5/activitydefinition.html)
/// - [FHIR R5 PlanDefinition](https://hl7.org/fhir/R5/plandefinition.html)
/// - [FHIR R5 Period
/// Datatype](https://hl7.org/fhir/R5/datatypes.html#Period)
///
pub effective_period: Option<Range>,
/// # additionalAttribute
///
/// ## Description
///
/// The `additionalAttribute` property defines extra attributes that can be
/// associated with concepts in a CodeSystem beyond the standard properties.
/// These attributes provide extended metadata and classification
/// capabilities for coded concepts.
///
/// ## Purpose
///
/// - Define custom properties for concepts beyond standard FHIR properties
/// - Support domain-specific metadata requirements
/// - Enable flexible concept classification and annotation
/// - Provide extensible property mechanisms for specialized terminologies
///
/// ## Usage
///
/// The `additionalAttribute` property is used within CodeSystem resources
/// to specify additional properties that can be assigned to concepts. These
/// properties extend the base concept model with custom attributes relevant
/// to the specific terminology domain.
///
/// ## Data Type
///
/// **array** of **CodeSystem.property** objects, each containing:
///
/// - `code` (string) - Unique identifier for the property
/// - `uri` (uri) - Optional URI that defines the property
/// - `description` (string) - Human-readable description of the property
/// - `type` (code) - Data type of the property value
/// (code|Coding|string|integer|boolean|dateTime|decimal)
///
/// ## Constraints
///
/// - Property codes must be unique within the CodeSystem
/// - Property type must be one of the allowed FHIR property types
/// - Properties defined here can be referenced in concept.property elements
/// - Description should clearly explain the purpose and usage of the
/// property
///
/// ## Examples
///
/// ### Clinical Terminology with Additional Attributes
///
/// ```json
/// {
/// "property": [
/// {
/// "code": "status",
/// "type": "code"
/// }
/// ],
/// "additionalAttribute": [
/// {
/// "code": "clinicalSeverity",
/// "description": "Clinical severity classification for the concept",
/// "type": "code"
/// },
/// {
/// "code": "bodySystem",
/// "description": "Primary body system affected",
/// "type": "string"
/// }
/// ]
/// }
/// ```
///
/// ### Laboratory Code System with Custom Properties
///
/// ```json
/// {
/// "additionalAttribute": [
/// {
/// "code": "specimen",
/// "description": "Preferred specimen type for this test",
/// "type": "code"
/// },
/// {
/// "code": "methodType",
/// "description": "Laboratory method category",
/// "type": "string"
/// },
/// {
/// "code": "normalRange",
/// "description": "Normal reference range",
/// "type": "string"
/// }
/// ]
/// }
/// ```
///
/// ## Related Keys
///
/// - `property` - Standard properties defined for the CodeSystem
/// - `concept` - Concepts that may use these additional attributes
/// - `code` - Unique identifier for the CodeSystem
/// - `content` - Indicates how complete the CodeSystem content is
///
/// ## Specification Reference
///
/// FHIR R5 CodeSystem: [Property
/// Definition](http://hl7.org/fhir/R5/codesystem.html#CodeSystem.property)
///
pub additional_attribute: Option<Vec<AdditionalAttribute>>,
/// # useContext
///
/// ## Description
///
/// The `useContext` property defines the specific contexts, situations, or
/// circumstances where a resource, profile, or artifact is intended to be
/// used. It provides machine-readable context information for appropriate
/// usage.
///
/// ## Purpose
///
/// - Define appropriate usage contexts for resources
/// - Enable context-aware resource discovery and selection
/// - Support automated filtering based on usage scenarios
/// - Facilitate implementation-specific resource management
/// - Provide semantic context for resource applicability
///
/// ## Usage
///
/// The `useContext` property is used in conformance and knowledge artifacts
/// to specify when and where they should be applied, helping systems choose
/// appropriate resources for specific situations.
///
/// ## Data Type
///
/// **Array of UsageContext** - Each UsageContext contains:
///
/// - `code` - The type of context (age, gender, species, etc.)
/// - `value[x]` - The specific context value (CodeableConcept, Quantity,
/// Range, Reference)
///
/// ## Constraints
///
/// - Must specify both code and value
/// - Code must be from the usage-context-type value set
/// - Value type must be appropriate for the context code
/// - Should provide meaningful filtering criteria
///
/// ## Examples
///
/// ### Age and Gender Context
///
/// ```json
/// {
/// "useContext": [
/// {
/// "code": {
/// "system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
/// "code": "age",
/// "display": "Age Range"
/// },
/// "valueRange": {
/// "low": {
/// "value": 18,
/// "unit": "years"
/// },
/// "high": {
/// "value": 65,
/// "unit": "years"
/// }
/// }
/// },
/// {
/// "code": {
/// "system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
/// "code": "gender",
/// "display": "Gender"
/// },
/// "valueCodeableConcept": {
/// "coding": [
/// {
/// "system": "http://hl7.org/fhir/administrative-gender",
/// "code": "female",
/// "display": "Female"
/// }
/// ]
/// }
/// }
/// ]
/// }
/// ```
///
/// ### Clinical Setting Context
///
/// ```json
/// {
/// "useContext": [
/// {
/// "code": {
/// "system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
/// "code": "venue",
/// "display": "Clinical Venue"
/// },
/// "valueCodeableConcept": {
/// "coding": [
/// {
/// "system": "http://snomed.info/sct",
/// "code": "440655000",
/// "display": "Outpatient environment"
/// }
/// ]
/// }
/// }
/// ]
/// }
/// ```
///
/// ## Related Keys
///
/// - `jurisdiction` - Legal/geographic applicability
/// - `context` - Additional context information
/// - `topic` - Subject matter topics
/// - `purpose` - Intended purpose description
///
/// ## Specification Reference
///
/// FHIR R5 Data Types:
/// [UsageContext](http://hl7.org/fhir/R5/metadatatypes.html#UsageContext)
///
pub use_context: Option<Vec<UseContext>>,
}
#[cfg(test)]
mod tests {
use super::*;
type T = Resource;
#[test]
fn test_serde_json_from_reader() {
let path = crate::r5::parse::concept_maps::DIR
.join("resource")
.join("resource.json");
let file = std::fs::File::open(path).expect("open");
let reader = std::io::BufReader::new(file);
let actual: T = ::serde_json::from_reader(reader).unwrap();
assert_eq!(actual.id, "cm-administrative-gender-v2");
}
}