Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/29 add record state #31

Merged
merged 11 commits into from
Dec 13, 2023
18 changes: 14 additions & 4 deletions src/main/java/cz/cvut/kbss/study/dto/PatientRecordDto.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}
22 changes: 14 additions & 8 deletions src/main/java/cz/cvut/kbss/study/model/PatientRecord.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
}
}
24 changes: 24 additions & 0 deletions src/main/java/cz/cvut/kbss/study/model/RecordPhase.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
30 changes: 30 additions & 0 deletions src/main/resources/model.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix form: <http://onto.fel.cvut.cz/ontologies/form/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ufo: <http://onto.fel.cvut.cz/ontologies/ufo/> .
@base <http://onto.fel.cvut.cz/ontologies/record-manager> .

<http://onto.fel.cvut.cz/ontologies/record-manager> rdf:type owl:Ontology ;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading