-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28a2a87
commit 439077a
Showing
129 changed files
with
27,108 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 0 additions & 84 deletions
84
messages/src/main/java/io/github/mjhaugsdal/kith/xml/M9NA1Factory.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
messages/src/main/java/io/github/mjhaugsdal/kith/xml/XMLUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.github.mjhaugsdal.kith.xml; | ||
|
||
import jakarta.xml.bind.JAXBContext; | ||
import jakarta.xml.bind.JAXBException; | ||
import jakarta.xml.bind.Marshaller; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.StringWriter; | ||
import java.nio.charset.Charset; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
public class XMLUtil { | ||
|
||
private static JAXBContext jaxbContext; | ||
|
||
private static Marshaller marshaller; | ||
|
||
private static jakarta.xml.bind.Unmarshaller unmarshaller; | ||
|
||
public XMLUtil(Class<?>... classes) { | ||
try { | ||
jaxbContext = JAXBContext.newInstance(classes); | ||
unmarshaller = jaxbContext.createUnmarshaller(); | ||
marshaller = jaxbContext.createMarshaller(); | ||
} catch (JAXBException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public Object unmarshall(String filePath) throws JAXBException { | ||
return unmarshaller.unmarshal(XMLUtil.class.getClassLoader().getResourceAsStream(filePath)); | ||
} | ||
|
||
public Object unmarshall(String xml, Charset charset) throws JAXBException { | ||
return unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes(charset))); | ||
} | ||
|
||
public String marshall(Object objectToBeMarshalled) throws JAXBException { | ||
StringWriter sw = new StringWriter(); | ||
marshaller.marshal(objectToBeMarshalled, sw); | ||
return sw.toString(); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
messages/src/main/resources/Diverse eksempler/ER-M14-2008-12-12-eksempel1-msghead.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<MsgHead xmlns="http://www.kith.no/xmlstds/msghead/2006-05-24" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsd="http://www.w3.org/2001/XMLSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kith.no/xmlstds/msghead/2006-05-24 ../felles/MsgHead-v1_2.xsd"> | ||
<MsgInfo> | ||
<Type V="ERM14" DN="Søknad til Legemiddelverket"/> | ||
<MIGversion>v1.2 2006-05-24</MIGversion> | ||
<GenDate>2007-03-12T19:20:00</GenDate> | ||
<MsgId>5f723921-76d0-44ed-acd0-f7ed2baec16c</MsgId> | ||
<Sender> | ||
<Organisation> | ||
<OrganisationName>Kattskinnet legesenter</OrganisationName> | ||
<Ident> | ||
<Id>971318864</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.9051" V="ENH" DN="Organisasjonsnummeret i Enhetsregister"/> | ||
</Ident> | ||
<HealthcareProfessional> | ||
<FamilyName>Koman</FamilyName> | ||
<GivenName>Magnar</GivenName> | ||
<Ident> | ||
<Id>009144889</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.8116" V="HPR" DN="HPR-nummer"/> | ||
</Ident> | ||
</HealthcareProfessional> | ||
</Organisation> | ||
</Sender> | ||
<Receiver> | ||
<Organisation> | ||
<OrganisationName>Statens Legemiddelverk, Avdeling for legemiddelgodkjenning</OrganisationName> | ||
<Ident> | ||
<Id>1234567890-example</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.9051" V="ENH" DN="Organisasjonsnummeret i Enhetsregister"/> | ||
</Ident> | ||
</Organisation> | ||
</Receiver> | ||
</MsgInfo> | ||
<Document> | ||
<RefDoc> | ||
<MsgType V="XML" DN="XML-instans"/> | ||
<Content> | ||
<SoknadSLV xsi:schemaLocation="http://www.kith.no/xmlstds/eresept/m14/2008-12-12 ER-M14-2008-12-12.xsd" xmlns="http://www.kith.no/xmlstds/eresept/m14/2008-12-12" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<ReseptId>7c77a590-317a-11dd-bd11-0800200c9a66</ReseptId> | ||
<AnmodningSLVId>f3eb5400-317a-11dd-bd11-0800200c9a66</AnmodningSLVId> | ||
</SoknadSLV> | ||
</Content> | ||
</RefDoc> | ||
</Document> | ||
</MsgHead> | ||
|
||
|
5 changes: 5 additions & 0 deletions
5
messages/src/main/resources/Diverse eksempler/ER-M14-2008-12-12-eksempel1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<SoknadSLV xsi:schemaLocation="http://www.kith.no/xmlstds/eresept/m14/2008-12-12 ER-M14-2008-12-12.xsd" xmlns="http://www.kith.no/xmlstds/eresept/m14/2008-12-12" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<ReseptId>7c77a590-317a-11dd-bd11-0800200c9a66</ReseptId> | ||
<AnmodningSLVId>f3eb5400-317a-11dd-bd11-0800200c9a66</AnmodningSLVId> | ||
</SoknadSLV> |
48 changes: 48 additions & 0 deletions
48
messages/src/main/resources/Diverse eksempler/ER-M15-2006-10-06-eksempel1-msghead.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<MsgHead xmlns="http://www.kith.no/xmlstds/msghead/2006-05-24" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsd="http://www.w3.org/2001/XMLSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kith.no/xmlstds/msghead/2006-05-24 ../felles/MsgHead-v1_2.xsd"> | ||
<MsgInfo> | ||
<Type V="ERM15" DN="Søknadssvar fra Legemiddelverket"/> | ||
<MIGversion>v1.2 2006-05-24</MIGversion> | ||
<GenDate>2007-03-12T19:20:00</GenDate> | ||
<MsgId>5f723921-76d0-44ed-acd0-f7ed2baec16c</MsgId> | ||
<Sender> | ||
<Organisation> | ||
<OrganisationName>Statens Legemiddelverk, Avdeling for legemiddelgodkjenning</OrganisationName> | ||
<Ident> | ||
<Id>1234567890-example</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.9051" V="ENH" DN="Organisasjonsnummeret i Enhetsregister"/> | ||
</Ident> | ||
</Organisation> | ||
</Sender> | ||
<Receiver> | ||
<Organisation> | ||
<OrganisationName>Kattskinnet legesenter</OrganisationName> | ||
<Ident> | ||
<Id>971318864</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.9051" V="ENH" DN="Organisasjonsnummeret i Enhetsregister"/> | ||
</Ident> | ||
<HealthcareProfessional> | ||
<FamilyName>Koman</FamilyName> | ||
<GivenName>Magnar</GivenName> | ||
<Ident> | ||
<Id>009144889</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.8116" V="HPR" DN="HPR-nummer"/> | ||
</Ident> | ||
</HealthcareProfessional> | ||
</Organisation> | ||
</Receiver> | ||
</MsgInfo> | ||
<Document> | ||
<RefDoc> | ||
<MsgType V="XML" DN="XML-instans"/> | ||
<Content> | ||
<SvarSLV xmlns="http://www.kith.no/xmlstds/eresept/m15/2006-10-06" xmlns:kith="http://www.kith.no/xmlstds" xmlns:xsd="http://www.w3.org/2001/XMLSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kith.no/xmlstds/eresept/m15/2006-10-06 ER-M15-2006-10-06.xsd"> | ||
<ReseptId>1234567890</ReseptId> | ||
<Innvilget V="N"/> | ||
<BegrunnelseAvslag>Statshemmelighet</BegrunnelseAvslag> | ||
<Saksbehandler>BEH123</Saksbehandler> | ||
</SvarSLV> | ||
</Content> | ||
</RefDoc> | ||
</Document> | ||
</MsgHead> |
58 changes: 58 additions & 0 deletions
58
messages/src/main/resources/Diverse eksempler/ER-M21-2013-10-08-eksempel1-msghead.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<MsgHead xmlns="http://www.kith.no/xmlstds/msghead/2006-05-24" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsd="http://www.w3.org/2001/XMLSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kith.no/xmlstds/msghead/2006-05-24 ../felles/MsgHead-v1_2.xsd"> | ||
<MsgInfo> | ||
<Type V="ERM21" DN="Ekspederingsanmodning"/> | ||
<MIGversion>v1.2 2006-05-24</MIGversion> | ||
<GenDate>2007-03-12T19:20:00</GenDate> | ||
<MsgId>fa662190-cc17-4a0d-959c-7e3c2a8523ff</MsgId> | ||
<Sender> | ||
<Organisation> | ||
<OrganisationName>Reseptformidleren</OrganisationName> | ||
<Ident> | ||
<Id>1234567890-example</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.9051" V="ENH" DN="Organisasjonsnummeret i Enhetsregister"/> | ||
</Ident> | ||
</Organisation> | ||
</Sender> | ||
<Receiver> | ||
<Organisation> | ||
<OrganisationName>Apoteket Flodhesten</OrganisationName> | ||
<Ident> | ||
<Id>971033541</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.9051" V="ENH" DN="Organisasjonsnummeret i Enhetsregister"/> | ||
</Ident> | ||
<Ident> | ||
<Id>9001</Id> | ||
<TypeId S="2.16.578.1.12.4.1.1.9051" V="AKO" DN="Apotekets konsesjonsnummer"/> | ||
</Ident> | ||
</Organisation> | ||
</Receiver> | ||
</MsgInfo> | ||
<Document> | ||
<RefDoc> | ||
<MsgType V="XML" DN="XML-instans"/> | ||
<Content> | ||
<Ekspederingsanmodning xsi:schemaLocation="http://www.kith.no/xmlstds/eresept/m21/2013-10-08 ER-M21-2013-10-08.xsd" xmlns:m1="http://www.kith.no/xmlstds/eresept/m1/2013-10-08" xmlns="http://www.kith.no/xmlstds/eresept/m21/2013-10-08" xmlns:fk1="http://www.kith.no/xmlstds/felleskomponent1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<ReseptId>8eaa6000-3ec6-11dd-ae16-0800200c9a66</ReseptId> | ||
<RefNr>THX1138</RefNr> | ||
<Fnr>15076500565</Fnr> | ||
<Navn>Roland Gundersen</Navn> | ||
<m1:EkspAnm> | ||
<m1:Vilkar>true</m1:Vilkar> | ||
<m1:MetodeEkspedering DN="Forsendelse" V="F"/> | ||
<m1:Utleverer>HER1234567890</m1:Utleverer> | ||
<m1:Kontaktperson>Roland Gundersen</m1:Kontaktperson> | ||
<m1:Adresse> | ||
<fk1:StreetAdr>Flåklypa 31</fk1:StreetAdr> | ||
<fk1:PostalCode>2560</fk1:PostalCode> | ||
<fk1:City>Alvdal</fk1:City> | ||
</m1:Adresse> | ||
<m1:Merknad>Ikke bruk innpakkingsmateriale laget av biomateriale grunnet allergi. </m1:Merknad> | ||
<m1:OrgNrUtleverer>971033541</m1:OrgNrUtleverer> | ||
<m1:UtlevererNavn>Heidundradegår Sykepleieartikler</m1:UtlevererNavn> | ||
</m1:EkspAnm> | ||
</Ekspederingsanmodning> | ||
</Content> | ||
</RefDoc> | ||
</Document> | ||
</MsgHead> |
7 changes: 7 additions & 0 deletions
7
messages/src/main/resources/Diverse eksempler/ER-M241-2009-02-20-eksempel1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Samtykke xsi:schemaLocation="http://www.kith.no/xmlstds/eresept/m241/2009-02-20 ER-M241-2009-02-20.xsd" xmlns="http://www.kith.no/xmlstds/eresept/m241/2009-02-20" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<SamtykkeGittAv DN="Kodeverk mangler" V="TODO"/> | ||
<SamtykkeTil>2077-03-12</SamtykkeTil> | ||
<TypeSamtykke DN="Samtykke for utleveringsmelding" V="1"/> | ||
<Samtykkeverdi DN="Ja" V="1"/> | ||
</Samtykke> |
5 changes: 5 additions & 0 deletions
5
messages/src/main/resources/Diverse eksempler/ER-M242-2008-10-03-eksempel1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<SvarSamtykke xsi:schemaLocation="http://www.kith.no/xmlstds/eresept/m242/2008-10-03 ER-M242-2008-10-03.xsd" xmlns="http://www.kith.no/xmlstds/eresept/m242/2008-10-03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<Svar DN="Avvist" V="2"/> | ||
<Begrunnelse DN="Rekvirent er ikke pasientens fastlege" V="2"/> | ||
</SvarSamtykke> |
5 changes: 5 additions & 0 deletions
5
messages/src/main/resources/Diverse eksempler/ER-M3-2010-05-01-eksempel1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<AnmodningSLV xsi:schemaLocation="http://www.kith.no/xmlstds/eresept/m3/2010-05-01 ER-M3-2010-05-01.xsd" xmlns="http://www.kith.no/xmlstds/eresept/m3/2010-05-01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<ReseptId>7c77a590-317a-11dd-bd11-0800200c9a66</ReseptId> | ||
<Kommentar>Denne bør dere ta en titt på</Kommentar> | ||
</AnmodningSLV> |
Oops, something went wrong.