Skip to content

Commit

Permalink
Add opal.core.enum docs and fix a number of renaming bugs in our docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmiller committed Jul 20, 2017
1 parent 47ff0e8 commit 556944a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/docs/guides/components_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It contains a core [data model](datamodel.md) for persisting clinical informatio
as well core clinical archetypes out of the box that build on many
years of collaboratively modelling clinical concepts by medical domain experts.

Opal also makes it easy to integrate standard clinical [reference data](lookup_lists.md)
Opal also makes it easy to integrate standard clinical [reference data](referencedata.md)
into your application - things like medical diagnoses, tests, drugs et cetera.

Some common functional components end up in to most clinical applications, and many
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/guides/datamodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ Opal comes with a set of clinical terminology data models out of the box. - we o
want to link our records to one of these - for example to record a type of condition
a patient might have, or a drug they are taking.

Full documentation of these is available in the [Lookup lists](lookup_lists.md) documentation.
Full documentation of these is available in the [Reference Data](referencedata.md) documentation.
34 changes: 34 additions & 0 deletions doc/docs/reference/core_fields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# opal.core.fields

The `opal.core.fields` module contains helper functions for working
with fields, as well as custom Opal field definitions.

## is_numeric

A helper function that returns true if a field is numeric. For our
purposes, Integers, Decimals, BigIntegers, Floats and Positive Integers
are considered numeric.

```python
is_numeric(models.IntegerField())
# -> True
```


## enum

A helper function that returns a Django choices definition from star args.

```Python
enum('one', '2', 'III')
# -> (
# ('one', 'one'),
# ('2', '2'),
# ('III', 'III')
# )
```

## ForeignKeyOrFreeText

A field that stores it's value as a generic foreign key to an Opal LookupList
or as the value in a CharField.
3 changes: 2 additions & 1 deletion doc/docs/reference/reference_guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ The following reference guides are available:
[opal.core.patient_lists](patient_list.md)|Patient Lists - defining different types of list|
[opal.core.plugin](plugin.md)| Plugins - defining plugins to package reusable functionality
[opal.core.menus](core_menus.md)| Menus - declaring application menus
[opal.core.log](core_log.md)| Log Helpers - custom email error loggers
[opal.core.log](loggers.md)| Log Helpers - custom email error loggers
[opal.core.fields](core_fields)| Field helpers - custom field types and utility functions|

### Angular Services
|
Expand Down
2 changes: 2 additions & 0 deletions doc/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ pages:
- OpalPlugin: reference/plugin.md
- Core.Views: reference/core_views.md
- Menus: reference/core_menus.md
- Log: reference/loggers.md
- Fields: reference/core_fields.md

# Angular Services
- reference/javascript/patient_service.md
Expand Down

0 comments on commit 556944a

Please sign in to comment.