<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model model-name="clinic" version="0.0.1">
  <enum name="Sex">
    <value name="FEMALE"/>
    <value name="MALE"/>
  </enum>
  <class name="Address" is-abstract="false" is-dictionary="false" embeddable="true">
    <property name="city" type="STRING" length="254"/>
    <property name="flatNo" type="STRING" length="254"/>
    <property name="street" type="STRING" length="254"/>
  </class>
  <class name="Clinic" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="address" type="Address"/>
    <property name="name" type="STRING" length="254"/>
  </class>
  <class name="ClinicCustomer" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <reference name="clinic" type="Clinic" mandatory="true"/>
    <reference name="customer" type="Customer" label="" mandatory="true" integrity-check="true"/>
  </class>
  <class name="ClinicDoctor" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <reference name="clinic" type="Clinic" mandatory="true"/>
    <reference name="doctor" type="Doctor" mandatory="true" integrity-check="true"/>
  </class>
  <class name="ClinicOffice" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="officeNum" type="STRING" mandatory="true" length="254"/>
    <property name="officeType" type="OfficeType" mandatory="true"/>
    <reference name="clinic" type="Clinic" mandatory="true" integrity-check="true"/>
  </class>
  <class name="ClinicSchedule" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="doctorScheduleList" type="DoctorSchedule" collection="SET" mappedBy="clinicSchedule"/>
    <reference name="clinic" type="Clinic" mandatory="true" integrity-check="true"/>
  </class>
  <class name="Customer" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="customerContactList" type="CustomerContact" collection="SET" mappedBy="customer"/>
    <property name="insuranceNum" type="STRING" mandatory="true" length="254"/>
    <reference name="person" type="Person" label="" mandatory="true" integrity-check="true"/>
  </class>
  <class name="CustomerContact" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="contactInfo" type="STRING" length="254"/>
    <property name="customer" type="Customer" parent="true"/>
  </class>
  <class name="Doctor" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="doctorType" type="DoctorType" mandatory="true"/>
    <reference name="person" type="Person" label="" mandatory="true" integrity-check="true"/>
  </class>
  <class name="DoctorAppointment" extends="Period" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="descr" type="STRING" length="254"/>
    <property name="doctorSchedule" type="DoctorSchedule" parent="true"/>
    <reference name="clinicCustomer" type="ClinicCustomer" label="" mandatory="true" integrity-check="true"/>
  </class>
  <class name="DoctorSchedule" extends="Period" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="clinicSchedule" type="ClinicSchedule" parent="true"/>
    <property name="doctorAppointmentList" type="DoctorAppointment" collection="SET" mappedBy="doctorSchedule"/>
    <reference name="clinicDoctor" type="ClinicDoctor" mandatory="true" integrity-check="true"/>
    <reference name="clinicOffice" type="ClinicOffice" label="" mandatory="true" integrity-check="true"/>
  </class>
  <class name="DoctorType" is-abstract="false" is-dictionary="true" embeddable="false">
    <property name="descr" type="STRING" length="254"/>
    <property name="name" type="STRING" mandatory="true" length="254"/>
  </class>
  <class name="OfficeType" is-abstract="false" is-dictionary="true" embeddable="false">
    <property name="name" type="STRING" mandatory="true" length="254"/>
  </class>
  <class name="Period" is-abstract="true" is-dictionary="false" embeddable="false">
    <property name="beginDate" type="LOCALDATETIME" mandatory="true" length="3"/>
    <property name="endDate" type="LOCALDATETIME" mandatory="true" length="3"/>
  </class>
  <class name="Person" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="AUTO_ON_EMPTY"/>
    <property name="birthDate" type="LOCALDATE"/>
    <property name="firstName" type="STRING" mandatory="true" length="254"/>
    <property name="lastName" type="STRING" mandatory="true" length="254">
      <historical>true</historical>
    </property>
    <property name="sex" type="Sex" mandatory="true"/>
  </class>
</model>
