added externalid to patient model