forked from PSMRI/FHIR-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrganizationDataModel.java
More file actions
88 lines (58 loc) · 2.54 KB
/
OrganizationDataModel.java
File metadata and controls
88 lines (58 loc) · 2.54 KB
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
package com.wipro.fhir.data.resource_model;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Component;
import com.wipro.fhir.utils.exception.FHIRException;
import lombok.Data;
@Component
@Data
public class OrganizationDataModel {
private Long benVisitID;
private Short serviceProviderID;
private String serviceProviderName;
private Integer stateID;
private String stateName;
private Integer districtID;
private String districtName;
private String locationName;
private String address;
private Short serviceID;
private String serviceName;
private Boolean isNational;
private String abdmFacilityId;
private String abdmFacilityName;
private Integer psAddMapID;
private Integer providerServiceMapID;
public OrganizationDataModel() {
}
public OrganizationDataModel(Object[] objArr) throws FHIRException {
try {
this.benVisitID = objArr[0] != null ? Long.parseLong(objArr[0].toString()) : null;
this.serviceProviderID = objArr[1] != null ? Short.parseShort(objArr[1].toString()) : null;
this.serviceProviderName = objArr[2] != null ? objArr[2].toString() : null;
this.stateID = objArr[3] != null ? Integer.parseInt(objArr[3].toString()) : null;
this.stateName = objArr[4] != null ? objArr[4].toString() : null;
this.districtID = objArr[5] != null ? Integer.parseInt(objArr[5].toString()) : null;
this.districtName = objArr[6] != null ? objArr[6].toString() : null;
this.locationName = objArr[7] != null ? objArr[7].toString() : null;
this.address = objArr[8] != null ? objArr[8].toString() : null;
this.serviceID = objArr[9] != null ? Short.parseShort(objArr[9].toString()) : null;
this.serviceName = objArr[10] != null ? objArr[10].toString() : null;
this.isNational = objArr[11] != null
? objArr[11].toString().equalsIgnoreCase("true") || objArr[11].toString().equals("1")
: null;
this.abdmFacilityId = objArr[12] != null ? objArr[12].toString() : null;
this.abdmFacilityName = objArr[13] != null ? objArr[13].toString() : null;
this.psAddMapID = objArr[14] != null ? Integer.parseInt(objArr[14].toString()) : null;
this.providerServiceMapID = objArr[15] != null ? Integer.parseInt(objArr[15].toString()) : null;
} catch (Exception e) {
throw new FHIRException("Organization resource failed with error - " + e.getMessage());
}
}
public OrganizationDataModel getOrganization(Object[] resultSet) throws FHIRException {
if (resultSet == null || resultSet.length == 0) {
return null;
}
return new OrganizationDataModel(resultSet);
}
}