package gov.cms.grouper.snf.r3;


import gov.cms.grouper.snf.SnfComponentVersion;

public class SnfComponent extends gov.cms.grouper.snf.r2.SnfComponent {

  private static final int OBRA_STARTVERSION = 105;

  public SnfComponent() {
    this(OBRA_STARTVERSION);
  }


  public SnfComponent(int dataVersion) {
    super(dataVersion);
    if ((SnfComponentVersion.r3.getFrom() <= dataVersion
        && dataVersion <= SnfComponentVersion.r3.getTo())
        == false) {
      throw new RuntimeException("Version miss match");
    }
  }


  @Override
  public Boolean hasIPA(Integer aiCode, Integer obra) {
    Boolean result = null;
    if (obra != null && obra != 99 && aiCode == null) {
      // OBRA assessment
      result = false;
    } else {
      result = super.hasIPA(aiCode, obra);
    }

    return result;

  }


}
