@@ -1702,7 +1702,7 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
17021702 name string
17031703 endpoint * fhir.Endpoint
17041704 parentOrgMap map [* fhir.Organization ][]* fhir.Organization
1705- allHealthcareServices []fhir.BundleEntry
1705+ allHealthcareServices []fhir.HealthcareService
17061706 shouldSucceed bool
17071707 description string
17081708 }{
@@ -1719,15 +1719,13 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
17191719 },
17201720 }: {},
17211721 },
1722- allHealthcareServices : []fhir.BundleEntry {
1722+ allHealthcareServices : []fhir.HealthcareService {
17231723 {
1724- Resource : mustMarshalJSON (& fhir.HealthcareService {
1725- Id : to .Ptr ("hcs-1" ),
1726- ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1727- Endpoint : []fhir.Reference {
1728- {Reference : to .Ptr ("Endpoint/endpoint-hcs-1" )},
1729- },
1730- }),
1724+ Id : to .Ptr ("hcs-1" ),
1725+ ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1726+ Endpoint : []fhir.Reference {
1727+ {Reference : to .Ptr ("Endpoint/endpoint-hcs-1" )},
1728+ },
17311729 },
17321730 },
17331731 shouldSucceed : true ,
@@ -1746,15 +1744,13 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
17461744 },
17471745 }: {},
17481746 },
1749- allHealthcareServices : []fhir.BundleEntry {
1747+ allHealthcareServices : []fhir.HealthcareService {
17501748 {
1751- Resource : mustMarshalJSON (& fhir.HealthcareService {
1752- Id : to .Ptr ("hcs-2" ),
1753- ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1754- Endpoint : []fhir.Reference {
1755- {Reference : to .Ptr ("http://example.org/fhir/Endpoint/endpoint-hcs-2" )},
1756- },
1757- }),
1749+ Id : to .Ptr ("hcs-2" ),
1750+ ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1751+ Endpoint : []fhir.Reference {
1752+ {Reference : to .Ptr ("http://example.org/fhir/Endpoint/endpoint-hcs-2" )},
1753+ },
17581754 },
17591755 },
17601756 shouldSucceed : true ,
@@ -1773,17 +1769,15 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
17731769 },
17741770 }: {},
17751771 },
1776- allHealthcareServices : []fhir.BundleEntry {
1772+ allHealthcareServices : []fhir.HealthcareService {
17771773 {
1778- Resource : mustMarshalJSON (& fhir.HealthcareService {
1779- Id : to .Ptr ("hcs-multi" ),
1780- ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1781- Endpoint : []fhir.Reference {
1782- {Reference : to .Ptr ("Endpoint/endpoint-hcs-1" )},
1783- {Reference : to .Ptr ("Endpoint/endpoint-hcs-2" )},
1784- {Reference : to .Ptr ("Endpoint/endpoint-hcs-3" )},
1785- },
1786- }),
1774+ Id : to .Ptr ("hcs-multi" ),
1775+ ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1776+ Endpoint : []fhir.Reference {
1777+ {Reference : to .Ptr ("Endpoint/endpoint-hcs-1" )},
1778+ {Reference : to .Ptr ("Endpoint/endpoint-hcs-2" )},
1779+ {Reference : to .Ptr ("Endpoint/endpoint-hcs-3" )},
1780+ },
17871781 },
17881782 },
17891783 shouldSucceed : true ,
@@ -1802,24 +1796,20 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
18021796 },
18031797 }: {},
18041798 },
1805- allHealthcareServices : []fhir.BundleEntry {
1799+ allHealthcareServices : []fhir.HealthcareService {
18061800 {
1807- Resource : mustMarshalJSON (& fhir.HealthcareService {
1808- Id : to .Ptr ("hcs-cardiology" ),
1809- ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1810- Endpoint : []fhir.Reference {
1811- {Reference : to .Ptr ("Endpoint/endpoint-cardio" )},
1812- },
1813- }),
1801+ Id : to .Ptr ("hcs-cardiology" ),
1802+ ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1803+ Endpoint : []fhir.Reference {
1804+ {Reference : to .Ptr ("Endpoint/endpoint-cardio" )},
1805+ },
18141806 },
18151807 {
1816- Resource : mustMarshalJSON (& fhir.HealthcareService {
1817- Id : to .Ptr ("hcs-emergency" ),
1818- ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1819- Endpoint : []fhir.Reference {
1820- {Reference : to .Ptr ("Endpoint/endpoint-hcs-4" )},
1821- },
1822- }),
1808+ Id : to .Ptr ("hcs-emergency" ),
1809+ ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1810+ Endpoint : []fhir.Reference {
1811+ {Reference : to .Ptr ("Endpoint/endpoint-hcs-4" )},
1812+ },
18231813 },
18241814 },
18251815 shouldSucceed : true ,
@@ -1841,14 +1831,12 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
18411831 },
18421832 }: {},
18431833 },
1844- allHealthcareServices : []fhir.BundleEntry {
1834+ allHealthcareServices : []fhir.HealthcareService {
18451835 {
1846- Resource : mustMarshalJSON (& fhir.HealthcareService {
1847- Id : to .Ptr ("hcs-1" ),
1848- Endpoint : []fhir.Reference {
1849- {Reference : to .Ptr ("Endpoint/endpoint-different" )},
1850- },
1851- }),
1836+ Id : to .Ptr ("hcs-1" ),
1837+ Endpoint : []fhir.Reference {
1838+ {Reference : to .Ptr ("Endpoint/endpoint-different" )},
1839+ },
18521840 },
18531841 },
18541842 shouldSucceed : false ,
@@ -1870,14 +1858,12 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
18701858 },
18711859 }: {},
18721860 },
1873- allHealthcareServices : []fhir.BundleEntry {
1861+ allHealthcareServices : []fhir.HealthcareService {
18741862 {
1875- Resource : mustMarshalJSON (& fhir.HealthcareService {
1876- Id : to .Ptr ("hcs-1" ),
1877- Endpoint : []fhir.Reference {
1878- {Reference : to .Ptr ("Endpoint/endpoint-shared" )},
1879- },
1880- }),
1863+ Id : to .Ptr ("hcs-1" ),
1864+ Endpoint : []fhir.Reference {
1865+ {Reference : to .Ptr ("Endpoint/endpoint-shared" )},
1866+ },
18811867 },
18821868 },
18831869 shouldSucceed : true ,
@@ -1897,15 +1883,13 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
18971883 // No endpoint references in organization
18981884 }: {},
18991885 },
1900- allHealthcareServices : []fhir.BundleEntry {
1886+ allHealthcareServices : []fhir.HealthcareService {
19011887 {
1902- Resource : mustMarshalJSON (& fhir.HealthcareService {
1903- Id : to .Ptr ("hcs-1" ),
1904- ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1905- Endpoint : []fhir.Reference {
1906- {Reference : to .Ptr ("Endpoint/endpoint-hcs-only" )},
1907- },
1908- }),
1888+ Id : to .Ptr ("hcs-1" ),
1889+ ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1890+ Endpoint : []fhir.Reference {
1891+ {Reference : to .Ptr ("Endpoint/endpoint-hcs-only" )},
1892+ },
19091893 },
19101894 },
19111895 shouldSucceed : true ,
@@ -1924,7 +1908,7 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
19241908 },
19251909 }: {},
19261910 },
1927- allHealthcareServices : []fhir.BundleEntry {},
1911+ allHealthcareServices : []fhir.HealthcareService {},
19281912 shouldSucceed : false ,
19291913 description : "should fail when healthcare services list is empty and endpoint not in org" ,
19301914 },
@@ -1941,12 +1925,10 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
19411925 },
19421926 }: {},
19431927 },
1944- allHealthcareServices : []fhir.BundleEntry {
1928+ allHealthcareServices : []fhir.HealthcareService {
19451929 {
1946- Resource : mustMarshalJSON (& fhir.HealthcareService {
1947- Id : to .Ptr ("hcs-1" ),
1948- Endpoint : nil , // No endpoints
1949- }),
1930+ Id : to .Ptr ("hcs-1" ),
1931+ Endpoint : nil , // No endpoints
19501932 },
19511933 },
19521934 shouldSucceed : false ,
@@ -1965,15 +1947,13 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
19651947 },
19661948 }: {},
19671949 },
1968- allHealthcareServices : []fhir.BundleEntry {
1950+ allHealthcareServices : []fhir.HealthcareService {
19691951 {
1970- Resource : mustMarshalJSON (& fhir.HealthcareService {
1971- Id : to .Ptr ("hcs-invalid" ),
1972- // Missing ProvidedBy - healthcare service is invalid
1973- Endpoint : []fhir.Reference {
1974- {Reference : to .Ptr ("Endpoint/endpoint-invalid" )},
1975- },
1976- }),
1952+ Id : to .Ptr ("hcs-invalid" ),
1953+ // Missing ProvidedBy - healthcare service is invalid
1954+ Endpoint : []fhir.Reference {
1955+ {Reference : to .Ptr ("Endpoint/endpoint-invalid" )},
1956+ },
19771957 },
19781958 },
19791959 shouldSucceed : false ,
@@ -1992,24 +1972,20 @@ func TestValidateEndpointResourceReferencedByHealthcareService(t *testing.T) {
19921972 },
19931973 }: {},
19941974 },
1995- allHealthcareServices : []fhir.BundleEntry {
1975+ allHealthcareServices : []fhir.HealthcareService {
19961976 {
1997- Resource : mustMarshalJSON (& fhir.HealthcareService {
1998- Id : to .Ptr ("hcs-invalid" ),
1999- // Missing ProvidedBy - invalid
2000- Endpoint : []fhir.Reference {
2001- {Reference : to .Ptr ("Endpoint/endpoint-mixed" )},
2002- },
2003- }),
1977+ Id : to .Ptr ("hcs-invalid" ),
1978+ // Missing ProvidedBy - invalid
1979+ Endpoint : []fhir.Reference {
1980+ {Reference : to .Ptr ("Endpoint/endpoint-mixed" )},
1981+ },
20041982 },
20051983 {
2006- Resource : mustMarshalJSON (& fhir.HealthcareService {
2007- Id : to .Ptr ("hcs-valid" ),
2008- ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
2009- Endpoint : []fhir.Reference {
2010- {Reference : to .Ptr ("Endpoint/endpoint-mixed" )},
2011- },
2012- }),
1984+ Id : to .Ptr ("hcs-valid" ),
1985+ ProvidedBy : & fhir.Reference {Reference : to .Ptr ("Organization/hospital-main" )},
1986+ Endpoint : []fhir.Reference {
1987+ {Reference : to .Ptr ("Endpoint/endpoint-mixed" )},
1988+ },
20131989 },
20141990 },
20151991 shouldSucceed : true ,
0 commit comments