Permalink
Browse files

Tilføjet tilskudsblanketter på SKRS

  • Loading branch information...
Kjeld Froberg
Kjeld Froberg committed Dec 3, 2012
1 parent 1c81774 commit b992f94372d7adb823b62a822d9e8e94ccc3cdec
@@ -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);
@@ -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));
+}
@@ -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

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -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()+"'");
}
@@ -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);
}
@@ -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;
+ }
+}
@@ -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;
+ }
+}
Oops, something went wrong.

0 comments on commit b992f94

Please sign in to comment.