Skip to content

Commit

Permalink
adding the @component to create beans of the loader and others
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 committed Nov 15, 2023
1 parent 90cbf72 commit 4f391a0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
import org.openmrs.module.initializer.api.CsvLine;
import org.openmrs.module.initializer.api.CsvParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@OpenmrsProfile(modules = { "fhir2:1.11.* - 9.*" }, openmrsPlatformVersion = "2.6.3 - 2.6.*, 2.7.* - 9.*")
public class FhirContactPointMapCsvParser extends CsvParser<FhirContactPointMap, BaseLineProcessor<FhirContactPointMap>> {

public static final String ATTRIBUTE_TYPE_DOMAIN_HEADER = "Entity name";

public static final String ATTRIBUTE_TYPE = "Attribute type";
public static final String ATTRIBUTE_TYPE = "Attribute Type";

private static final String LOCATION = "location";

Expand Down Expand Up @@ -116,9 +118,7 @@ protected PersonAttributeType getPersonAttributeType(String attributeType) {
return personAttributeType;
}

personAttributeType = personService.getPersonAttributeTypeByUuid(attributeType);

return personAttributeType;
return personService.getPersonAttributeTypeByUuid(attributeType);
}

protected BaseAttributeType<?> getBaseAttributeType(String attributeDomain, String attributeType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import org.openmrs.module.fhir2.model.FhirContactPointMap;
import org.openmrs.module.initializer.api.BaseLineProcessor;
import org.openmrs.module.initializer.api.CsvLine;
import org.springframework.stereotype.Component;

import static org.openmrs.module.initializer.api.fhir.cpm.FhirContactPointMapCsvParser.ATTRIBUTE_TYPE_DOMAIN_HEADER;

@Component
@OpenmrsProfile(modules = { "fhir2:1.11.* - 9.*" }, openmrsPlatformVersion = "2.6.3 - 2.6.*, 2.7.* - 9.*")
public class FhirContactPointMapLineProcessor extends BaseLineProcessor<FhirContactPointMap> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
import org.openmrs.module.fhir2.model.FhirContactPointMap;
import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@OpenmrsProfile(modules = { "fhir2:1.11.* - 9.*" }, openmrsPlatformVersion = "2.6.3 - 2.6.*, 2.7.* - 9.*")
public class FhirContactPointMapLoader extends BaseCsvLoader<FhirContactPointMap, FhirContactPointMapCsvParser> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public void setup() {
fhirContactPointMap.setSystem(ContactPoint.ContactPointSystem.PHONE);
fhirContactPointMap.setUse(ContactPoint.ContactPointUse.WORK);
fhirContactPointMap.setRank(1);

fhirContactPointMapService.saveFhirContactPointMap(fhirContactPointMap);
personService.savePersonAttributeType(personAttributeType);
}

@Test
Expand Down

0 comments on commit 4f391a0

Please sign in to comment.