23
23
import org .openmrs .module .initializer .api .CsvParser ;
24
24
import org .springframework .beans .factory .annotation .Autowired ;
25
25
26
- @ OpenmrsProfile (modules = { "fhir2:1.11.* - 9.*" }, openmrsPlatformVersion = "2.6.3 - 2.6.*, 2.7.* - 9.*" )
26
+ import static org .openmrs .module .initializer .Domain .FHIR_CONTACT_POINT_MAP ;
27
+
28
+ @ OpenmrsProfile (modules = { "fhir2:2.0.* - 9.*" }, openmrsPlatformVersion = "2.6.3 - 2.6.*, 2.7.* - 9.*" )
27
29
public class FhirContactPointMapCsvParser extends CsvParser <FhirContactPointMap , BaseLineProcessor <FhirContactPointMap >> {
28
30
29
31
public static final String ATTRIBUTE_TYPE_DOMAIN_HEADER = "Entity name" ;
@@ -45,8 +47,9 @@ public class FhirContactPointMapCsvParser extends CsvParser<FhirContactPointMap,
45
47
private final FhirContactPointMapService fhirContactPointMapService ;
46
48
47
49
@ Autowired
48
- protected FhirContactPointMapCsvParser (FhirContactPointMapService fhirContactPointMapService ,BaseLineProcessor <FhirContactPointMap > lineProcessor ,
49
- LocationService locationService , PersonService personService , ProviderService providerService ) {
50
+ protected FhirContactPointMapCsvParser (FhirContactPointMapService fhirContactPointMapService ,
51
+ BaseLineProcessor <FhirContactPointMap > lineProcessor , LocationService locationService , PersonService personService ,
52
+ ProviderService providerService ) {
50
53
super (lineProcessor );
51
54
this .fhirContactPointMapService = fhirContactPointMapService ;
52
55
this .locationService = locationService ;
@@ -58,8 +61,7 @@ protected FhirContactPointMapCsvParser(FhirContactPointMapService fhirContactPoi
58
61
public FhirContactPointMap bootstrap (CsvLine line ) throws IllegalArgumentException {
59
62
FhirContactPointMap contactPointMap = null ;
60
63
if (line .getUuid () != null ) {
61
- contactPointMap = fhirContactPointMapService .getFhirContactPointMapByUuid (line .getUuid ())
62
- .orElse (null );
64
+ contactPointMap = fhirContactPointMapService .getFhirContactPointMapByUuid (line .getUuid ()).orElse (null );
63
65
}
64
66
65
67
if (contactPointMap != null ) {
@@ -74,21 +76,21 @@ public FhirContactPointMap bootstrap(CsvLine line) throws IllegalArgumentExcepti
74
76
75
77
if (personAttributeType == null ) {
76
78
throw new IllegalArgumentException ("PersonAttributeType " + attributeType
77
- + " does not exist. Please ensure your Initializer configuration contains this attribute type." );
79
+ + " does not exist. Please ensure your Initializer configuration contains this attribute type." );
78
80
}
79
81
80
82
contactPointMap = fhirContactPointMapService .getFhirContactPointMapForPersonAttributeType (personAttributeType )
81
- .orElse (null );
83
+ .orElse (null );
82
84
} else {
83
85
BaseAttributeType <?> baseAttributeType = getBaseAttributeType (attributeTypeDomain , attributeType );
84
86
85
87
if (baseAttributeType == null ) {
86
88
throw new IllegalArgumentException (
87
- "Could not find attribute type " + attributeType + " for attribute domain " + attributeTypeDomain );
89
+ "Could not find attribute type " + attributeType + " for attribute domain " + attributeTypeDomain );
88
90
}
89
91
90
92
contactPointMap = fhirContactPointMapService .getFhirContactPointMapForAttributeType (baseAttributeType )
91
- .orElse (null );
93
+ .orElse (null );
92
94
}
93
95
94
96
if (contactPointMap != null ) {
@@ -97,7 +99,6 @@ public FhirContactPointMap bootstrap(CsvLine line) throws IllegalArgumentExcepti
97
99
98
100
return new FhirContactPointMap ();
99
101
}
100
-
101
102
102
103
@ Override
103
104
public FhirContactPointMap save (FhirContactPointMap instance ) {
@@ -106,7 +107,7 @@ public FhirContactPointMap save(FhirContactPointMap instance) {
106
107
107
108
@ Override
108
109
public Domain getDomain () {
109
- return Domain . FHIR_CONTACT_POINT_MAP ;
110
+ return FHIR_CONTACT_POINT_MAP ;
110
111
}
111
112
112
113
protected PersonAttributeType getPersonAttributeType (String attributeType ) {
0 commit comments