Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tilføjet tilskudsblanketter på SKRS

  • Loading branch information...
commit b992f94372d7adb823b62a822d9e8e94ccc3cdec 1 parent 1c81774
@kfroberg kfroberg authored
Showing with 15,751 additions and 6 deletions.
  1. +6 −1 common/common/src/main/java/com/trifork/stamdata/persistence/RecordFetcher.java
  2. +71 −0 common/common/src/main/java/com/trifork/stamdata/specs/TilskudsblanketRecordSpecs.java
  3. +3 −0  doc/releases/release-3.4.21.txt
  4. +7,975 −0 dodi/data-manager/stamdata-data-manager.log.2
  5. +7,055 −0 dodi/data-manager/stamdata-data-manager.log.3
  6. +19 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/replication/webservice/StamdataReplicationImpl.java
  7. +14 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/ViewModule.java
  8. +90 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/Blanket.java
  9. +92 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/BlanketEnkelt.java
  10. +90 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/BlanketForhoejet.java
  11. +90 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/BlanketKroniker.java
  12. +89 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/BlanketTerminal.java
  13. +97 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/ForhoejetTakst.java
  14. +33 −0 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/package-info.java
  15. +27 −5 ...ch-copy-ws/src/test/java/dk/nsi/stamdata/replication/webservice/StamdataReplicationImplIntegrationTest.java
View
7 common/common/src/main/java/com/trifork/stamdata/persistence/RecordFetcher.java
@@ -104,7 +104,12 @@ public Record fetchCurrent(String key, RecordSpecification recordSpecification)
while(resultSet.next())
{
Instant validFrom = new Instant(resultSet.getTimestamp("ValidFrom"));
- Instant validTo = new Instant(resultSet.getTimestamp("ValidTo"));
+ // Validto can be null - and a new Instant with null as argument gives "now"
+ Timestamp vto = resultSet.getTimestamp("ValidTo");
+ Instant validTo = null;
+ if(vto != null) {
+ validTo = new Instant(vto);
+ }
Instant modifiedDate = new Instant(resultSet.getTimestamp("ModifiedDate"));
Long pid = (Long) resultSet.getObject("PID");
Record record = createRecordFromResultSet(recordSpecification, resultSet);
View
71 common/common/src/main/java/com/trifork/stamdata/specs/TilskudsblanketRecordSpecs.java
@@ -0,0 +1,71 @@
+/**
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Contributor(s): Contributors are attributed in the source code
+ * where applicable.
+ *
+ * The Original Code is "Stamdata".
+ *
+ * The Initial Developer of the Original Code is Trifork Public A/S.
+ *
+ * Portions created for the Original Code are Copyright 2011,
+ * Lægemiddelstyrelsen. All Rights Reserved.
+ *
+ * Portions created for the FMKi Project are Copyright 2011,
+ * National Board of e-Health (NSI). All Rights Reserved.
+ */
+package com.trifork.stamdata.specs;
+
+import com.trifork.stamdata.persistence.RecordSpecification;
+import static com.trifork.stamdata.persistence.RecordSpecification.field;
+
+
+/**
+ * Specifikation af feltlænger og -navne for de forskellige balnkettyper
+ */
+public class TilskudsblanketRecordSpecs {
+
+ public static final RecordSpecification BLANKET_RECORD_SPEC = RecordSpecification.createSpecification("Tilskudsblanket", "BlanketId",
+ field("BlanketId", 15).numerical(),
+ field("BlanketTekst", 21000));
+
+
+ public static final RecordSpecification BLANKET_ENKELTTILSKUD_RECORD_SPEC = RecordSpecification.createSpecification("TilskudsblanketEnkelt", "BlanketId",
+ field("BlanketId", 15).numerical(),
+ field("Genansoegning", 1).numerical(),
+ field("Navn", 100),
+ field("Form", 100));
+
+ public static final RecordSpecification BLANKET_FORHOJETTILSKUD_RECORD_SPEC = RecordSpecification.createSpecification("TilskudsblanketForhoejet", "BlanketId",
+ field("BlanketId", 15).numerical(),
+ field("DrugId", 12).numerical());
+
+
+ public static final RecordSpecification BLANKET_KRONIKERTILSKUD_RECORD_SPEC = RecordSpecification.createSpecification("TilskudsblanketKroniker", "BlanketId",
+ field("BlanketId", 15).numerical(),
+ field("Genansoegning", 1).numerical());
+
+ public static final RecordSpecification BLANKET_TERMINALTILSKUD_RECORD_SPEC = RecordSpecification.createSpecification("TilskudsblanketTerminal", "BlanketId",
+ field("BlanketId", 15).numerical());
+
+
+ public static final RecordSpecification FORHOEJETTAKST_RECORD_SPEC = RecordSpecification.createSpecification("TilskudForhoejetTakst", "Varenummer",
+ field("Varenummer", 10).numerical(),
+ field("Navn", 30),
+ field("Form", 30),
+ field("FormTekst", 150),
+ field("ATCkode", 10),
+ field("Styrke", 30),
+ field("DrugID", 12).numerical(),
+ field("PakningsTekst", 30),
+ field("Udlevering", 10),
+ field("Tilskudstype", 10));
+}
View
3  doc/releases/release-3.4.21.txt
@@ -4,3 +4,6 @@ Stamdata 3.4.21 Release Notes
* Fixed NSPSUPPORT-129, Fixed personMapper på SCES. så den ikke længere sender bygningsnummer med ud.
* Fixed NSPSUPPORT-131, Forbedret fejlhåndtering ved DGWS faults
+
+
+search index=main sourcetype=minlog (_indextime > %d AND _indextime < %d) | fields %s | sort by _indextime asc
View
7,975 dodi/data-manager/stamdata-data-manager.log.2
7,975 additions, 0 deletions not shown
View
7,055 dodi/data-manager/stamdata-data-manager.log.3
7,055 additions, 0 deletions not shown
View
19 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/replication/webservice/StamdataReplicationImpl.java
@@ -52,6 +52,7 @@
import com.trifork.stamdata.persistence.RecordSpecification;
import com.trifork.stamdata.specs.BemyndigelseRecordSpecs;
import com.trifork.stamdata.specs.SikredeRecordSpecs;
+import com.trifork.stamdata.specs.TilskudsblanketRecordSpecs;
import com.trifork.stamdata.specs.VaccinationRecordSpecs;
import com.trifork.stamdata.specs.VitaminRecordSpecs;
import com.trifork.stamdata.specs.YderregisterRecordSpecs;
@@ -148,6 +149,7 @@ private boolean isRecordRegister(ReplicationRequestType parameters)
|| ("yderregister".equals(parameters.getRegister()) && "person".equals(parameters.getDatatype()) && parameters.getVersion() == 1)
|| ("bemyndigelsesservice".equals(parameters.getRegister()) && "bemyndigelse".equals(parameters.getDatatype()) && parameters.getVersion() == 1)
|| ("vitamin".equals(parameters.getRegister()) && parameters.getVersion() == 1)
+ || ("tilskudsblanket".equals(parameters.getRegister()) && parameters.getVersion() == 1)
|| ("ddv".equals(parameters.getRegister()) && parameters.getVersion() == 1);
}
@@ -234,6 +236,23 @@ else if ("ddv".equals(parameters.getRegister())) {
throw new IllegalStateException("Datatype: '"+parameters.getDatatype()+"' not known on register '"+parameters.getRegister()+"'");
}
}
+ else if ("tilskudsblanket".equals(parameters.getRegister())) {
+ if("forhoejettakst".equals(parameters.getDatatype())) {
+ recordSpecification = TilskudsblanketRecordSpecs.FORHOEJETTAKST_RECORD_SPEC;
+ } else if("blanket".equals(parameters.getDatatype())) {
+ recordSpecification = TilskudsblanketRecordSpecs.BLANKET_RECORD_SPEC;
+ } else if("blanketterminal".equals(parameters.getDatatype())) {
+ recordSpecification = TilskudsblanketRecordSpecs.BLANKET_TERMINALTILSKUD_RECORD_SPEC;
+ } else if("blanketforhoejet".equals(parameters.getDatatype())) {
+ recordSpecification = TilskudsblanketRecordSpecs.BLANKET_FORHOJETTILSKUD_RECORD_SPEC;
+ } else if("blanketkroniker".equals(parameters.getDatatype())) {
+ recordSpecification = TilskudsblanketRecordSpecs.BLANKET_KRONIKERTILSKUD_RECORD_SPEC;
+ } else if("blanketenkelt".equals(parameters.getDatatype())) {
+ recordSpecification = TilskudsblanketRecordSpecs.BLANKET_ENKELTTILSKUD_RECORD_SPEC;
+ } else {
+ throw new IllegalStateException("Datatype: '"+parameters.getDatatype()+"' not known on register '"+parameters.getRegister()+"'");
+ }
+ }
else {
throw new IllegalStateException("Datatype: '"+parameters.getDatatype()+"' not known on register '"+parameters.getRegister()+"'");
}
View
14 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/ViewModule.java
@@ -84,6 +84,12 @@
import dk.nsi.stamdata.views.sor.Sygehus;
import dk.nsi.stamdata.views.sor.SygehusAfdeling;
import dk.nsi.stamdata.views.sor.Yder;
+import dk.nsi.stamdata.views.tilskudsblanket.Blanket;
+import dk.nsi.stamdata.views.tilskudsblanket.BlanketEnkelt;
+import dk.nsi.stamdata.views.tilskudsblanket.BlanketForhoejet;
+import dk.nsi.stamdata.views.tilskudsblanket.BlanketKroniker;
+import dk.nsi.stamdata.views.tilskudsblanket.BlanketTerminal;
+import dk.nsi.stamdata.views.tilskudsblanket.ForhoejetTakst;
import dk.nsi.stamdata.views.vaccination.Disease;
import dk.nsi.stamdata.views.vaccination.DiseaseVaccine;
import dk.nsi.stamdata.views.vaccination.Dosageoption;
@@ -193,6 +199,14 @@ protected void configure()
views.addBinding().to(VaccinationPlanItem.class);
views.addBinding().to(Vaccine.class);
views.addBinding().to(VaccineDrug.class);
+
+ // Tilskudsblanketter
+ views.addBinding().to(Blanket.class);
+ views.addBinding().to(BlanketEnkelt.class);
+ views.addBinding().to(BlanketForhoejet.class);
+ views.addBinding().to(BlanketKroniker.class);
+ views.addBinding().to(BlanketTerminal.class);
+ views.addBinding().to(ForhoejetTakst.class);
}
View
90 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/Blanket.java
@@ -0,0 +1,90 @@
+/**
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Contributor(s): Contributors are attributed in the source code
+ * where applicable.
+ *
+ * The Original Code is "Stamdata".
+ *
+ * The Initial Developer of the Original Code is Trifork Public A/S.
+ *
+ * Portions created for the Original Code are Copyright 2011,
+ * Lægemiddelstyrelsen. All Rights Reserved.
+ *
+ * Portions created for the FMKi Project are Copyright 2011,
+ * National Board of e-Health (NSI). All Rights Reserved.
+ */
+package dk.nsi.stamdata.views.tilskudsblanket;
+
+import static javax.persistence.TemporalType.TIMESTAMP;
+
+import java.math.BigInteger;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Temporal;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import dk.nsi.stamdata.views.View;
+import dk.nsi.stamdata.views.ViewPath;
+
+@Entity
+@XmlRootElement
+@ViewPath("tilskudsblanket/blanket/v1")
+public class Blanket extends View {
+
+ protected Blanket() {
+ }
+
+ @Id
+ @GeneratedValue
+ @XmlTransient
+ @Column(name = "TilskudsblanketPID")
+ private BigInteger recordID;
+
+
+ @XmlElement(required = true)
+ public String blanketId;
+
+ public String blanketTekst;
+
+ @XmlTransient
+ @Temporal(TIMESTAMP)
+ public Date modifiedDate;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validFrom;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validTo;
+
+ @Override
+ public BigInteger getRecordID() {
+ return recordID;
+ }
+
+ @Override
+ public String getId() {
+ return blanketId;
+ }
+
+ @Override
+ public Date getUpdated() {
+ return modifiedDate;
+ }
+}
View
92 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/BlanketEnkelt.java
@@ -0,0 +1,92 @@
+/**
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Contributor(s): Contributors are attributed in the source code
+ * where applicable.
+ *
+ * The Original Code is "Stamdata".
+ *
+ * The Initial Developer of the Original Code is Trifork Public A/S.
+ *
+ * Portions created for the Original Code are Copyright 2011,
+ * Lægemiddelstyrelsen. All Rights Reserved.
+ *
+ * Portions created for the FMKi Project are Copyright 2011,
+ * National Board of e-Health (NSI). All Rights Reserved.
+ */
+
+package dk.nsi.stamdata.views.tilskudsblanket;
+
+import static javax.persistence.TemporalType.TIMESTAMP;
+
+import java.math.BigInteger;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Temporal;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import dk.nsi.stamdata.views.View;
+import dk.nsi.stamdata.views.ViewPath;
+
+@Entity
+@XmlRootElement
+@ViewPath("tilskudsblanket/blanketenkelt/v1")
+public class BlanketEnkelt extends View {
+
+ protected BlanketEnkelt() {
+ }
+
+ @Id
+ @GeneratedValue
+ @XmlTransient
+ @Column(name = "TilskudsblanketEnkeltPID")
+ private BigInteger recordID;
+
+ @XmlElement(required = true)
+ public String blanketId;
+
+ public String genansoegning;
+ public String navn;
+ public String form;
+
+ @XmlTransient
+ @Temporal(TIMESTAMP)
+ public Date modifiedDate;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validFrom;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validTo;
+
+ @Override
+ public BigInteger getRecordID() {
+ return recordID;
+ }
+
+ @Override
+ public String getId() {
+ return blanketId;
+ }
+
+ @Override
+ public Date getUpdated() {
+ return modifiedDate;
+ }
+}
View
90 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/BlanketForhoejet.java
@@ -0,0 +1,90 @@
+/**
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Contributor(s): Contributors are attributed in the source code
+ * where applicable.
+ *
+ * The Original Code is "Stamdata".
+ *
+ * The Initial Developer of the Original Code is Trifork Public A/S.
+ *
+ * Portions created for the Original Code are Copyright 2011,
+ * Lægemiddelstyrelsen. All Rights Reserved.
+ *
+ * Portions created for the FMKi Project are Copyright 2011,
+ * National Board of e-Health (NSI). All Rights Reserved.
+ */
+
+package dk.nsi.stamdata.views.tilskudsblanket;
+
+import static javax.persistence.TemporalType.TIMESTAMP;
+
+import java.math.BigInteger;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Temporal;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import dk.nsi.stamdata.views.View;
+import dk.nsi.stamdata.views.ViewPath;
+
+@Entity
+@XmlRootElement
+@ViewPath("tilskudsblanket/blanketforhoejet/v1")
+public class BlanketForhoejet extends View {
+
+ protected BlanketForhoejet() {
+ }
+
+ @Id
+ @GeneratedValue
+ @XmlTransient
+ @Column(name = "TilskudsblanketForhoejetPID")
+ private BigInteger recordID;
+
+ @XmlElement(required = true)
+ public String blanketId;
+
+ public String drugId;
+
+ @XmlTransient
+ @Temporal(TIMESTAMP)
+ public Date modifiedDate;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validFrom;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validTo;
+
+ @Override
+ public BigInteger getRecordID() {
+ return recordID;
+ }
+
+ @Override
+ public String getId() {
+ return blanketId;
+ }
+
+ @Override
+ public Date getUpdated() {
+ return modifiedDate;
+ }
+}
View
90 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/BlanketKroniker.java
@@ -0,0 +1,90 @@
+/**
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Contributor(s): Contributors are attributed in the source code
+ * where applicable.
+ *
+ * The Original Code is "Stamdata".
+ *
+ * The Initial Developer of the Original Code is Trifork Public A/S.
+ *
+ * Portions created for the Original Code are Copyright 2011,
+ * Lægemiddelstyrelsen. All Rights Reserved.
+ *
+ * Portions created for the FMKi Project are Copyright 2011,
+ * National Board of e-Health (NSI). All Rights Reserved.
+ */
+
+package dk.nsi.stamdata.views.tilskudsblanket;
+
+import static javax.persistence.TemporalType.TIMESTAMP;
+
+import java.math.BigInteger;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Temporal;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import dk.nsi.stamdata.views.View;
+import dk.nsi.stamdata.views.ViewPath;
+
+@Entity
+@XmlRootElement
+@ViewPath("tilskudsblanket/blanketkroniker/v1")
+public class BlanketKroniker extends View {
+
+ protected BlanketKroniker() {
+ }
+
+ @Id
+ @GeneratedValue
+ @XmlTransient
+ @Column(name = "TilskudsblanketKronikerPID")
+ private BigInteger recordID;
+
+ @XmlElement(required = true)
+ public String blanketId;
+
+ public String genansoegning;
+
+ @XmlTransient
+ @Temporal(TIMESTAMP)
+ public Date modifiedDate;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validFrom;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validTo;
+
+ @Override
+ public BigInteger getRecordID() {
+ return recordID;
+ }
+
+ @Override
+ public String getId() {
+ return blanketId;
+ }
+
+ @Override
+ public Date getUpdated() {
+ return modifiedDate;
+ }
+}
View
89 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/BlanketTerminal.java
@@ -0,0 +1,89 @@
+/**
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Contributor(s): Contributors are attributed in the source code
+ * where applicable.
+ *
+ * The Original Code is "Stamdata".
+ *
+ * The Initial Developer of the Original Code is Trifork Public A/S.
+ *
+ * Portions created for the Original Code are Copyright 2011,
+ * Lægemiddelstyrelsen. All Rights Reserved.
+ *
+ * Portions created for the FMKi Project are Copyright 2011,
+ * National Board of e-Health (NSI). All Rights Reserved.
+ */
+
+package dk.nsi.stamdata.views.tilskudsblanket;
+
+import static javax.persistence.TemporalType.TIMESTAMP;
+
+import java.math.BigInteger;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Temporal;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import dk.nsi.stamdata.views.View;
+import dk.nsi.stamdata.views.ViewPath;
+
+@Entity
+@XmlRootElement
+@ViewPath("tilskudsblanket/blanketterminal/v1")
+public class BlanketTerminal extends View {
+
+ protected BlanketTerminal() {
+ }
+
+ @Id
+ @GeneratedValue
+ @XmlTransient
+ @Column(name = "TilskudsblanketTerminalPID")
+ private BigInteger recordID;
+
+
+ @XmlElement(required = true)
+ public String blanketId;
+
+ @XmlTransient
+ @Temporal(TIMESTAMP)
+ public Date modifiedDate;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validFrom;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validTo;
+
+ @Override
+ public BigInteger getRecordID() {
+ return recordID;
+ }
+
+ @Override
+ public String getId() {
+ return blanketId;
+ }
+
+ @Override
+ public Date getUpdated() {
+ return modifiedDate;
+ }
+}
View
97 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/ForhoejetTakst.java
@@ -0,0 +1,97 @@
+/**
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Contributor(s): Contributors are attributed in the source code
+ * where applicable.
+ *
+ * The Original Code is "Stamdata".
+ *
+ * The Initial Developer of the Original Code is Trifork Public A/S.
+ *
+ * Portions created for the Original Code are Copyright 2011,
+ * Lægemiddelstyrelsen. All Rights Reserved.
+ *
+ * Portions created for the FMKi Project are Copyright 2011,
+ * National Board of e-Health (NSI). All Rights Reserved.
+ */
+
+package dk.nsi.stamdata.views.tilskudsblanket;
+
+import static javax.persistence.TemporalType.TIMESTAMP;
+
+import java.math.BigInteger;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Temporal;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import dk.nsi.stamdata.views.View;
+import dk.nsi.stamdata.views.ViewPath;
+
+@Entity
+@XmlRootElement
+@ViewPath("tilskudsblanket/forhoejettakst/v1")
+public class ForhoejetTakst extends View {
+
+ protected ForhoejetTakst() {
+ }
+
+ @Id
+ @GeneratedValue
+ @XmlTransient
+ @Column(name = "TilskudForhoejetTakstPID")
+ private BigInteger recordID;
+
+ @XmlElement(required = true)
+ public String varenummer;
+
+ public String form;
+ public String formTekst;
+ public String aTCkode;
+ public String styrke;
+ public String drugId;
+ public String pakningstekst;
+ public String udlevering;
+ public String tilskudsType;
+
+ @XmlTransient
+ @Temporal(TIMESTAMP)
+ public Date modifiedDate;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validFrom;
+
+ @Temporal(TIMESTAMP)
+ @XmlElement(required = true)
+ public Date validTo;
+
+ @Override
+ public BigInteger getRecordID() {
+ return recordID;
+ }
+
+ @Override
+ public String getId() {
+ return varenummer;
+ }
+
+ @Override
+ public Date getUpdated() {
+ return modifiedDate;
+ }
+}
View
33 nsp/batch-copy-ws/src/main/java/dk/nsi/stamdata/views/tilskudsblanket/package-info.java
@@ -0,0 +1,33 @@
+/**
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Contributor(s): Contributors are attributed in the source code
+ * where applicable.
+ *
+ * The Original Code is "Stamdata".
+ *
+ * The Initial Developer of the Original Code is Trifork Public A/S.
+ *
+ * Portions created for the Original Code are Copyright 2011,
+ * Lægemiddelstyrelsen. All Rights Reserved.
+ *
+ * Portions created for the FMKi Project are Copyright 2011,
+ * National Board of e-Health (NSI). All Rights Reserved.
+ */
+
+
+@XmlSchema(namespace = STAMDATA_3_0 + "/tilskudsblanket", elementFormDefault = XmlNsForm.QUALIFIED)
+package dk.nsi.stamdata.views.tilskudsblanket;
+
+import static com.trifork.stamdata.Namespace.STAMDATA_3_0;
+
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
View
32 ...copy-ws/src/test/java/dk/nsi/stamdata/replication/webservice/StamdataReplicationImplIntegrationTest.java
@@ -78,6 +78,7 @@
import com.trifork.stamdata.persistence.RecordSpecification;
import com.trifork.stamdata.specs.BemyndigelseRecordSpecs;
import com.trifork.stamdata.specs.SikredeRecordSpecs;
+import com.trifork.stamdata.specs.TilskudsblanketRecordSpecs;
import com.trifork.stamdata.specs.VitaminRecordSpecs;
import com.trifork.stamdata.specs.YderregisterRecordSpecs;
@@ -150,7 +151,8 @@ public void setUp() throws Exception
"vitamin/firmadata/v1",
"vitamin/udgaaedenavne/v1",
"vitamin/indholdsstoffer/v1",
- "cpr/barnrelation/v1"});
+ "cpr/barnrelation/v1",
+ "tilskudsblanket/forhoejettakst/v1"});
}
@After
@@ -482,13 +484,33 @@ public void testVitaminGrunddataCopy() throws Exception {
assertResponseContainsRecordAtom("vitamin", "grunddata");
- //printDocument(anyAsElement.getOwnerDocument(), System.out);
+ printDocument(anyAsElement.getOwnerDocument(), System.out);
assertResponseContainsExactNumberOfRecords("grunddata:grunddata", 2);
assertResponseContainsValueOnXPath("//grunddata:grunddata/grunddata:drugID", "1234567");
}
- // Helper methods
+ @Test
+ public void testTilskudsblanketForhoejetTakstCopy() throws Exception {
+ recordSpecification = TilskudsblanketRecordSpecs.FORHOEJETTAKST_RECORD_SPEC;
+ Record record = new RecordBuilder(TilskudsblanketRecordSpecs.FORHOEJETTAKST_RECORD_SPEC).field("Varenummer", 1234567).addDummyFieldsAndBuild();
+ records.add(record);
+ Record record2 = new RecordBuilder(TilskudsblanketRecordSpecs.FORHOEJETTAKST_RECORD_SPEC).field("Varenummer", 9876543).addDummyFieldsAndBuild();
+ records.add(record2);
+
+ createReplicationRequest("tilskudsblanket", "forhoejettakst");
+
+ populateDatabaseAndSendRequest();
+
+ assertResponseContainsRecordAtom("tilskudsblanket", "forhoejettakst");
+
+ //printDocument(anyAsElement.getOwnerDocument(), System.out);
+
+ assertResponseContainsExactNumberOfRecords("forhoejettakst:forhoejettakst", 2);
+ assertResponseContainsValueOnXPath("//forhoejettakst:forhoejettakst/forhoejettakst:Varenummer", "1234567");
+ }
+
+ // Helper methods
// Pretty print XML document - good for debugging
private static void printDocument(Document doc, OutputStream out) {
@@ -613,6 +635,7 @@ private XPathExpression createXpathExpression(String expression) throws XPathExp
"sikrede", "http://nsi.dk/-/stamdata/3.0/sikrede",
"yder", "http://nsi.dk/-/stamdata/3.0/yderregister",
"grunddata", "http://nsi.dk/-/stamdata/3.0/vitamin",
+ "forhoejettakst", "http://nsi.dk/-/stamdata/3.0/tilskudsblanket",
"bemyndigelse", "http://nsi.dk/-/stamdata/3.0/bemyndigelsesservice");
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
@@ -666,8 +689,7 @@ private void sendRequest() throws Exception, ReplicationFault
if (isClientAuthority)
{
- SecurityWrapper secutityHeadersNotWhitelisted = DGWSHeaderUtil
- .getVocesTrustedSecurityWrapper(WHITELISTED_CVR);
+ SecurityWrapper secutityHeadersNotWhitelisted = DGWSHeaderUtil.getVocesTrustedSecurityWrapper(WHITELISTED_CVR);
securityHeader = secutityHeadersNotWhitelisted.getSecurity();
medcomHeader = secutityHeadersNotWhitelisted.getMedcomHeader();
} else
Please sign in to comment.
Something went wrong with that request. Please try again.