diff --git a/src/main/java/cz/cvut/kbss/study/dto/PatientRecordDto.java b/src/main/java/cz/cvut/kbss/study/dto/PatientRecordDto.java index 2c8a69c1..1489461b 100644 --- a/src/main/java/cz/cvut/kbss/study/dto/PatientRecordDto.java +++ b/src/main/java/cz/cvut/kbss/study/dto/PatientRecordDto.java @@ -1,10 +1,7 @@ package cz.cvut.kbss.study.dto; import cz.cvut.kbss.jopa.model.annotations.*; -import cz.cvut.kbss.study.model.AbstractEntity; -import cz.cvut.kbss.study.model.Institution; -import cz.cvut.kbss.study.model.User; -import cz.cvut.kbss.study.model.Vocabulary; +import cz.cvut.kbss.study.model.*; import cz.cvut.kbss.study.model.util.HasOwlKey; import java.util.Date; @@ -39,6 +36,10 @@ public class PatientRecordDto extends AbstractEntity implements HasOwlKey { @OWLObjectProperty(iri = Vocabulary.s_p_was_treated_at, fetch = FetchType.EAGER) private Institution institution; + @Enumerated(EnumType.OBJECT_ONE_OF) + @OWLObjectProperty(iri = Vocabulary.s_p_has_phase) + private RecordPhase phase; + @Override public String getKey() { return key; @@ -105,12 +106,21 @@ public void setFormTemplate(String formTemplate) { this.formTemplate = formTemplate; } + public RecordPhase getPhase() { + return phase; + } + + public void setPhase(RecordPhase phase) { + this.phase = phase; + } + @Override public String toString() { return "PatientRecordDto{" + "localName=" + localName + "dateCreated=" + dateCreated + ", institution=" + institution + + ", phase=" + phase + "} " + super.toString(); } } diff --git a/src/main/java/cz/cvut/kbss/study/model/PatientRecord.java b/src/main/java/cz/cvut/kbss/study/model/PatientRecord.java index f64db877..7afedf16 100644 --- a/src/main/java/cz/cvut/kbss/study/model/PatientRecord.java +++ b/src/main/java/cz/cvut/kbss/study/model/PatientRecord.java @@ -1,13 +1,6 @@ package cz.cvut.kbss.study.model; -import cz.cvut.kbss.jopa.model.annotations.CascadeType; -import cz.cvut.kbss.jopa.model.annotations.FetchType; -import cz.cvut.kbss.jopa.model.annotations.Id; -import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; -import cz.cvut.kbss.jopa.model.annotations.OWLClass; -import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; -import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; -import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; +import cz.cvut.kbss.jopa.model.annotations.*; import cz.cvut.kbss.study.model.qam.Question; import cz.cvut.kbss.study.model.util.HasOwlKey; @@ -52,6 +45,10 @@ public class PatientRecord implements Serializable, HasOwlKey { CascadeType.REMOVE}, fetch = FetchType.EAGER) private Question question; + @Enumerated(EnumType.OBJECT_ONE_OF) + @OWLObjectProperty(iri = Vocabulary.s_p_has_phase) + private RecordPhase phase; + public URI getUri() { return uri; } @@ -134,12 +131,21 @@ public void setFormTemplate(String formTemplate) { this.formTemplate = formTemplate; } + public RecordPhase getPhase() { + return phase; + } + + public void setPhase(RecordPhase phase) { + this.phase = phase; + } + @Override public String toString() { return "PatientRecord{" + "localName=" + localName + ", dateCreated=" + dateCreated + ", institution=" + institution + + ", phase=" + phase + "} " + super.toString(); } } diff --git a/src/main/java/cz/cvut/kbss/study/model/RecordPhase.java b/src/main/java/cz/cvut/kbss/study/model/RecordPhase.java new file mode 100644 index 00000000..042ad262 --- /dev/null +++ b/src/main/java/cz/cvut/kbss/study/model/RecordPhase.java @@ -0,0 +1,24 @@ +package cz.cvut.kbss.study.model; + +import cz.cvut.kbss.jopa.model.annotations.Individual; + +public enum RecordPhase { + @Individual(iri = Vocabulary.s_c_open_record_phase) + open(Vocabulary.s_c_open_record_phase), + @Individual(iri = Vocabulary.s_c_valid_record_phase) + valid(Vocabulary.s_c_valid_record_phase), + @Individual(iri = Vocabulary.s_c_completed_record_phase) + completed(Vocabulary.s_c_completed_record_phase), + @Individual(iri = Vocabulary.s_c_published_record_phase) + published(Vocabulary.s_c_published_record_phase); + + private final String iri; + + RecordPhase(String iri) { + this.iri = iri; + } + + public String getIri() { + return iri; + } +} diff --git a/src/main/resources/model.ttl b/src/main/resources/model.ttl index 39067f2b..168363f9 100644 --- a/src/main/resources/model.ttl +++ b/src/main/resources/model.ttl @@ -7,6 +7,7 @@ @prefix xsd: . @prefix form: . @prefix rdfs: . +@prefix ufo: . @base . rdf:type owl:Ontology ; @@ -74,6 +75,11 @@ rm:relates-to rdf:type owl:ObjectProperty . rm:was-treated-at rdf:type owl:ObjectProperty ; rdfs:subPropertyOf rm:relates-to . +### http://onto.fel.cvut.cz/ontologies/record-manager/has-phase +rm:has-phase rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf rdf:type ; + rdfs:label "has phase"@en . + ################################################################# # Data properties @@ -163,5 +169,29 @@ rm:user rdf:type owl:Class ; rm:impersonator rdf:type owl:Class ; rdfs:label "Impersonator"@en . +### http://onto.fel.cvut.cz/ontologies/record-manager/record-phase +rm:record-phase rdf:type owl:Class ; + rdfs:subClassOf ufo:phase ; + rdfs:label "record state"@en . + +### http://onto.fel.cvut.cz/ontologies/record-manager/open-record-phase +rm:open-record-phase rdf:type owl:Class ; + rdfs:subClassOf rm:record-phase ; + rdfs:label "open record state"@en . + +### http://onto.fel.cvut.cz/ontologies/record-manager/valid-record-phase +rm:valid-record-phase rdf:type owl:Class ; + rdfs:subClassOf rm:record-phase ; + rdfs:label "valid record state"@en . + +### http://onto.fel.cvut.cz/ontologies/record-manager/completed-record-phase +rm:completed-record-phase rdf:type owl:Class ; + rdfs:subClassOf rm:record-phase ; + rdfs:label "completed record state"@en . + +### http://onto.fel.cvut.cz/ontologies/record-manager/published-record-phase +rm:published-record-phase rdf:type owl:Class ; + rdfs:subClassOf rm:record-phase ; + rdfs:label "published record state"@en . ### Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi