1
2
3
4
5
6
7
8
9
10
11
12
13
14 package uk.nhs.interoperability.client.samples.cda;
15
16 import java.util.UUID;
17
18 import uk.nhs.interoperability.transform.TransformManager;
19
20
21
22
23
24
25
26
27 public class NonCodedCDA {
28
29
30 String messageId;
31
32
33
34
35
36
37 public String getMessageId() {
38 return messageId;
39 }
40
41
42
43
44
45
46 public String getNHSNumber() {
47 return nhsNumber;
48 }
49
50
51
52
53
54
55 public void setNHSNumber(String nhsNumber) {
56 this.nhsNumber = nhsNumber;
57 }
58
59
60
61
62
63
64 public String getGivenName() {
65 return givenName;
66 }
67
68
69
70
71
72
73 public void setGivenName(String givenName) {
74 this.givenName = givenName;
75 }
76
77
78
79
80
81
82 public String getSurname() {
83 return surname;
84 }
85
86
87
88
89
90
91 public void setSurname(String surname) {
92 this.surname = surname;
93 }
94
95
96
97
98
99
100 public String getDateOfBirth() {
101 return dateOfBirth;
102 }
103
104
105
106
107
108
109 public void setDateOfBirth(String dateOfBirth) {
110 this.dateOfBirth = dateOfBirth;
111 }
112
113
114 String nhsNumber;
115
116
117 String givenName;
118
119
120 String surname;
121
122
123 String dateOfBirth;
124
125
126 String presentationText;
127
128
129
130
131
132
133 public String getPresentationText() {
134 return presentationText;
135 }
136
137
138
139
140
141
142 public void setPresentationText(String presentationText) {
143 this.presentationText = presentationText;
144 }
145
146
147
148
149
150
151 public String serialise(){
152 String XML = "<Message>";
153 XML += "<MessageId>"+messageId+"</MessageId>";
154 XML += "<NHSNumber>"+nhsNumber+"</NHSNumber>";
155 XML += "<GivenName>"+givenName+"</GivenName>";
156 XML += "<Surname>"+surname+"</Surname>";
157 XML += "<DateOfBirth>"+dateOfBirth+"</DateOfBirth>";
158 XML += "<PresentationText>"+presentationText+"</PresentationText>";
159 XML += "</Message>";
160 String serialisedMessage ="";
161 try {
162 serialisedMessage = TransformManager.doTransform("ToNonCodedCDA.xslt", XML);
163 } catch (Exception e) {
164
165 e.printStackTrace();
166 }
167 return serialisedMessage;
168 }
169
170
171
172
173 public NonCodedCDA(){
174 UUID messageId = UUID.randomUUID();
175 this.messageId = messageId.toString().toUpperCase();
176 }
177
178 }