Exemplo n.º 1
0
    __tablename__ = 'provider'
    __table_args__ = {"schema": 'gentem'}

    updated_at = Column(types.DateTime, default=datetime.utcnow())
    name = Column(types.String(255))
    address = Column(types.String(255))
    phone = Column(types.String(255))
    npi = Column(types.Date)
    type = Column(types.String(255))


class ProviderSchema(schema.DBSchema):
    name = fields.Str(required=True, allow_none=False)
    address = fields.Str(required=False, allow_none=True)
    phone = fields.Str(required=False, allow_none=True)
    npi = fields.Str(required=True, allow_none=False)
    type = fields.Str(validate=OneOf(ProviderType.list()),
                      required=True,
                      allow_none=False)

    @post_load
    def make_object(self, data, **kargs):
        return Provider(**data)


schema = ProviderSchema()

dao = dao.PostgresDAO(schema, Provider, session)

service = service.EntityService(dao=dao, schema=schema)
Exemplo n.º 2
0
                                  allow_none=False)
    serviceDateTo = fields.Date(attribute='service_date_to',
                                required=False,
                                allow_none=True)
    placeOfService = fields.Str(attribute='place_of_service',
                                required=True,
                                allow_none=False)
    emergencyIndicator = fields.Boolean(attribute='emergency_indicator',
                                        required=False,
                                        allow_none=True)
    idQualifier = fields.Str(attribute='id_qualifier',
                             required=False,
                             allow_none=True)
    renderingProviderId = fields.Str(attribute='rendering_provider_id',
                                     required=False,
                                     allow_none=True)
    EPSDTFamilyPlan = fields.Str(attribute='epsdt_family_plan',
                                 required=False,
                                 allow_none=True)

    @post_load
    def make_object(self, data, **kargs):
        return ServiceLine(**data)


schema = ServiceLineSchema()

dao = dao.PostgresDAO(schema, ServiceLine, session)

service = service.EntityService(dao=dao, schema=schema)
Exemplo n.º 3
0
    DENIED = 'Denied'
    APPEALED = 'Appealed'
    PAYED = 'Payed'
    REQUESTED_MORE_INFORMATION = 'Requested more information'

    @staticmethod
    def list():
        return list(map(lambda state: state.value, State))


class ClaimState(DBModel):
    __tablename__ = 'claim_state'
    __table_args__ = {"schema": 'gentem'}

    state = Column(types.String(255))
    claim_id = Column(types.String(36), ForeignKey('gentem.claim.id'))


class ClaimStateSchema(schema.DBSchema):
    state = fields.Str(attribute='state', required=True, allow_none=False, validate=OneOf(State.list()))
    claimId = fields.Str(attribute='claim_id', required=False, allow_none=True)
    @post_load
    def make_object(self, data, **kargs):
        return ClaimState(**data)


schema = ClaimStateSchema()

dao = dao.PostgresDAO(schema, ClaimState, session)

service = service.EntityService(dao=dao, schema=schema)
Exemplo n.º 4
0
    member_id = Column(types.String(255))
    email = Column(types.String(255))


class ProfileSchema(schema.DBSchema):
    firstName = fields.Str(attribute='first_name',
                           required=True,
                           allow_none=False)
    lastName = fields.Str(attribute='last_name',
                          required=True,
                          allow_none=False)
    middleInitial = fields.Str(attribute='middle_initial')
    address = fields.Str(required=False, allow_none=True)
    phone = fields.Str(required=True, allow_none=False)
    dob = fields.Date(required=True, allow_none=False)
    gender = fields.Str(required=True,
                        allow_none=False,
                        validate=OneOf(Gender.list()))
    memberId = fields.Str(attribute='member_id',
                          required=True,
                          allow_none=False)
    email = fields.Str(required=True, allow_none=False)

    @post_load
    def make_object(self, data, **kargs):
        return Profile(**data)


schema = ProfileSchema()
profile_dao = dao.PostgresDAO(schema, Profile, session)
service = service.EntityService(dao=profile_dao, schema=schema)